Fancy caching with on-disk persistence