Some tweaks to caching to do more stuff in the background.