instance method
caches_page
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v3.2.22.5Signature
caches_page(*actions)
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? }
Parameters
-
actionsrest
Source
# File actionpack/lib/action_controller/caching/pages.rb, line 94
def caches_page(*actions)
return unless perform_caching
options = actions.extract_options!
after_filter({:only => actions}.merge(options)) { |c| c.cache_page }
end
Defined in actionpack/lib/action_controller/caching/pages.rb line 94
· View on GitHub
· Improve this page
· Find usages on GitHub