Speed improvements for the caching layer, suggested by @minigod