Improved caching mechanism