Add caching functionality