Skip to content

Instantly share code, notes, and snippets.

@Gregg
Created February 10, 2009 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gregg/61159 to your computer and use it in GitHub Desktop.
Save Gregg/61159 to your computer and use it in GitHub Desktop.
# action/fragment caching options for your environment.rb
config.cache_store = :memory_store
config.cache_store = :syncronized_memory_store
config.cache_store = :file_store, "/path/to/cache/directory"
config.cache_store = :drb_store, "druby://localhost:9192"
config.cache_store = :mem_cache_store
config.cache_store = :mem_cache_store, "123.456.78.9:1001"
config.cache_store = :mem_cache_store, { :namespace => 'storeapp' }
config.cache_store = :compressed_mem_cache_store
config.cache_store = :custom_store
# To do action caching
caches_action :show, :index
# without layout
caches_action :show, :index, :layout => false
# with a conditional
caches_action :index, :show,
:if => Proc.new { |controller| !controller.params[:no_cache] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment