Mint_store is a project mainly written in Ruby, based on the MIT license.
Mint store for merb-cache based on http://blog.disqus.net/2008/06/11/mintcache-simple-version/
More detailed information is available at http://gom-jabbar.org/articles/2008/12/15/introducing-mint-store-a-strategic-store-for-merb-cache
It's basically a port of Disqus MintCache with two additionnal features:
Merb.run_later
Read returns nil the first time the cache becomes stale and then returns the stale cache for :mint_delay
seconds.
So on the contrary to using fetch where none of the clients will be penalized, if you use read, you will penalize one clients who will have to wait for the cache to be refreshed before his request is served.
Note: fetch_fragment
and fetch_partial
from merb-cache both use fetch
Mint Store accepts several initialization options:
:force_delete
if set to true, delete will just delete the data from the cache:need_expire_in
if set to true, writable? will return false if the :expire_in
condition is not present. If you are going to use MintStore with the AdHocStore it makes sense to set it.:expire_in
) and the real :expire_in
given to memcached (default: 30s):expire_in
value given to memcached while regenerating the cache (can set to 0 if you want memcache to never expire the stale cache while waiting for it to be refreshed)Example: setting the options