Module

ActionController::Caching::Pages::ClassMethods

Inheritance

Methods

Instance

Visibility Signature
public cache_page (content, path)
public caches_page (*actions)
public expire_page (path)

Instance Method Detail

cache_page(content, path)

Manually cache the content in the key determined by path. Example:

  cache_page "I'm the cached content", "/lists/show"

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

expire_page(path)

Expires the page that was cached with the path as a key. Example:

  expire_page "/lists/show"