various improvements to new caching mechanism