Implement in-memory cache.