Caching based on dynamic data