Conditional Caching plugin

Plugin details

Provides additional options for the caches_action method. The cache filter accepts any number of actions and two optional parameters :if and :tag.

Websitehttp://www.redlinesoftware.com/ Repositoryhttp://svn.redlinesoftware.com/plugins/conditional_cache/ Author Redline Software Inc. Tags Cache, option LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://svn.redlinesoftware.com/plugins/conditional_cache/

Provided an :if and :tag for the :list action

  caches_action :list, :if => :allow_caching, :tag => :cache_tag


This will cache the page dependant on the type of user logged in. The tag (string) is appended to the end of the cache key so use expire_fragment with a regex to safely expire actions that use the :tag option.

  caches_action :list, :tag => Proc.new {|controller| controller.user_type.to_s}

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (1 older version) | Last edited by: scott, 7 months ago