Method: ActionController::Caching::Pages::ClassMethods#caches_page
- Defined in:
- lib/action_controller/caching/pages.rb
#caches_page(*actions) ⇒ Object
Caches the actions using the page-caching approach that’ll store the cache in a path within the page_cache_directory that matches the triggering url.
Usage:
# cache the index action
caches_page :index
# cache the index action except for JSON requests
caches_page :index, :if => Proc.new { |c| !c.request.format.json? }
94 95 96 97 98 |
# File 'lib/action_controller/caching/pages.rb', line 94 def caches_page(*actions) return unless perform_caching = actions. after_filter({:only => actions}.merge()) { |c| c.cache_page } end |