Simplified caching logic.