Added support for caching on disk rather than memory.