partially moving caching from cache_latest branch