Type:
Module

Caching is a cheap way of speeding up slow applications by keeping the result of calculations, renderings, and database calls around for subsequent requests.

You can read more about each approach by clicking the modules below.

Note: To turn off all caching, set

1
config.action_controller.perform_caching = false

Caching stores

All the caching stores from ActiveSupport::Cache are available to be used as backends for Action Controller caching.

Configuration examples (MemoryStore is the default):

1
2
3
4
5
config.action_controller.cache_store = :memory_store
config.action_controller.cache_store = :file_store, '/path/to/cache/directory'
config.action_controller.cache_store = :mem_cache_store, 'localhost'
config.action_controller.cache_store = :mem_cache_store, Memcached::Rails.new('localhost:11211')
config.action_controller.cache_store = MyOwnStore.new('parameter')
cache
  • References/Ruby on Rails/Rails/Classes/ActionController/ActionController::Caching

cache(key, options = {}, &block) Instance Protected methods Convenience

2025-01-10 15:47:30
cache_store=
  • References/Ruby on Rails/Rails/Classes/ActionController/ActionController::Caching/ActionController::Caching::ConfigMethods

cache_store=(store) Instance Public methods

2025-01-10 15:47:30
cache_store
  • References/Ruby on Rails/Rails/Classes/ActionController/ActionController::Caching/ActionController::Caching::ConfigMethods

cache_store() Instance Public methods

2025-01-10 15:47:30
view_cache_dependencies
  • References/Ruby on Rails/Rails/Classes/ActionController/ActionController::Caching

view_cache_dependencies() Instance Public methods

2025-01-10 15:47:30
read_fragment
  • References/Ruby on Rails/Rails/Classes/ActionController/ActionController::Caching/ActionController::Caching::Fragments

read_fragment(key, options = nil) Instance Public methods Reads a cached fragment

2025-01-10 15:47:30
write_fragment
  • References/Ruby on Rails/Rails/Classes/ActionController/ActionController::Caching/ActionController::Caching::Fragments

write_fragment(key, content, options = nil) Instance Public methods Writes

2025-01-10 15:47:30
fragment_cache_key
  • References/Ruby on Rails/Rails/Classes/ActionController/ActionController::Caching/ActionController::Caching::Fragments

fragment_cache_key(key) Instance Public methods Given a key (as described in

2025-01-10 15:47:30
expire_fragment
  • References/Ruby on Rails/Rails/Classes/ActionController/ActionController::Caching/ActionController::Caching::Fragments

expire_fragment(key, options = nil) Instance Public methods Removes fragments

2025-01-10 15:47:30
view_cache_dependency
  • References/Ruby on Rails/Rails/Classes/ActionController/ActionController::Caching/ActionController::Caching::ClassMethods

view_cache_dependency(&dependency) Instance Public methods

2025-01-10 15:47:30
fragment_exist?
  • References/Ruby on Rails/Rails/Classes/ActionController/ActionController::Caching/ActionController::Caching::Fragments

fragment_exist?(key, options = nil) Instance Public methods Check if a cached

2025-01-10 15:47:30