Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

lordelph
Copy link
Contributor

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.

…is increases the performance of LifetimeFileCache which previously would perform two unserialize operations, one during contains() and then a second during fetch()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant