Implement (optional) caching.