github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

giom / mint_store

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 6
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Mint store for merb-cache based on http://blog.disqus.net/2008/06/11/mintcache-simple-version/ — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Added some more informations 
giom (author)
Mon Dec 15 10:13:19 -0800 2008
commit  77bcb792438b6a3b5bea653d65eb68eb20c1801d
tree    1abb85599fe57841519ff8f0c34c9985352e88ed
parent  8c086294862b859505421bf7126e369509faca00
mint_store /
name age
history
message
file .gitignore Loading commit data...
file LICENSE
file README.md
file Rakefile
file TODO
directory lib/
file mint_store.gemspec
directory spec/
README.md

More Information

More detailed information is available at http://gom-jabbar.org/articles/2008/12/15/introducing-mint-store-a-strategic-store-for-merb-cache

Mint Store is...

It's basically a port of Disqus MintCache with two additionnal features: - When you use fetch (and provide a block), if the cache is stale, Mint Store will return the stale cache and update the cache (with the result of executing the provided block) after the request has been served using Merb.run_later - Deletion will just mark the cache as stale which will cause the next fetch to repopulate the cache.

Read and Fetch

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

Initialization Options

Mint Store accepts several initialization options: - Behaviour 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.
  • Default values:
    • :mint_delay : the difference between the stale date (that you provide by :expire_in) and the real :expire_in given to memcached (default: 30s)
    • :refresh_delay : the :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)
    • :expire_in : default value for the stale date if not provided (default: 300s)

Example: setting the options

<code:ruby>

    register(:memcached_store, Merb::Cache::MemcachedStore)
    register(:mint_store, Merb::Cache::MintStore[:memcached_store], :need_expire_in => true, :refresh_delay => 0)

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server