CacheBundle icon indicating copy to clipboard operation
CacheBundle copied to clipboard

optimized performance of LifetimeFileCache by having FileCache retain last fetch

Open lordelph opened this issue 12 years ago • 0 comments

Once a cache is warmed up, an application will call CacheInterface::contains() and CacheInterface::fetch() in rapid succession. The LifetimeFileCache would perform a file_get_contents() and unserialize() operation for both of these calls, which for a large object can be expensive.

To remedy this, I've added extra smarts to FileCache so that it retains the very last thing which was fetched, so that if it is re-requested by the application or a derived class, it will return the in-memory copy.

lordelph avatar Jun 12 '13 16:06 lordelph