Skip to content
A rails plugin for building in-process caches that invalidate after each request.
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
MIT-LICENSE
README.markdown
Rakefile
init.rb
install.rb
uninstall.rb

README.markdown

Has Local Cache

An in-process cache that resets at the end of a request.

Memcached is fast, but an app can get really slow if it's hit too frequently. Some things should be considered valid throughout a request. This helps with those things.

I may fold this functionality into cache_fu itself, but this plugin will at least help me (and you) get some experience with in-process caches first.

Usage

class SomeModel < ActiveRecord::Base
  acts_as_cached
  has_local_cache
end

SomeModel.get_cache('somekey') do
  # Some expensive code that will run if the local cache
  # and memcached both return nothing.
end

Copyright (c) 2008 Dustin Sallings, released under the MIT license

Something went wrong with that request. Please try again.