public Method

ClassMethods.cache_page(content, path)

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

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

Source Code

# File action_controller/caching/pages.rb, line 70
def cache_page(content, path)
  return unless perform_caching

  benchmark "Cached page: #{page_cache_file(path)}" do
    FileUtils.makedirs(File.dirname(page_cache_path(path)))
    File.open(page_cache_path(path), "wb+") { |f| f.write(content) }
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.