Flowdock
method

caches_page

Importance_1
Ruby on Rails latest stable (v5.2.3) - 0 notes - Class: ActionController::Caching::Pages::ClassMethods

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.

caches_page(*actions) public

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.

You can also pass a :gzip option to override the class configuration one.

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? }

# don't gzip images
caches_page :image, :gzip => false
Show source
Register or log in to add new notes.