Optimization for caching.