Skip to content

Instantly share code, notes, and snippets.

@Gregg
Created January 23, 2009 21:25
Show Gist options
  • Save Gregg/51205 to your computer and use it in GitHub Desktop.
Save Gregg/51205 to your computer and use it in GitHub Desktop.
# In your development.rb to enable caching in development mode
config.action_controller.perform_caching = true
# To change page_cache folder location in your environment.rb
config.action_controller.page_cache_directory = RAILS_ROOT + "/public/cache"
# Code snippets
caches_page :show, :index
expires_cache :controller => 'posts', :action => 'index'
expires_cache :controller => 'posts', :action => 'show', :id => @post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment