Skip to content

Instantly share code, notes, and snippets.

@Gregg
Created February 10, 2009 01:45
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/61168 to your computer and use it in GitHub Desktop.
Save Gregg/61168 to your computer and use it in GitHub Desktop.
# Caching in the view
<% cache("#{@city.name}-photos") do %>
...
<% end %>
# Expiring the view
expire_fragment "#{city.name}-photos"
# Caching in the controller
write_fragment(key, content, options = nil)
read_fragment(key, options = nil)
fragment_exist?(key, options = nil)
expire_fragment(key, options = nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment