Skip to content

Instantly share code, notes, and snippets.

@tibbon
Created August 15, 2013 23:22
Show Gist options
  • Save tibbon/6245906 to your computer and use it in GitHub Desktop.
Save tibbon/6245906 to your computer and use it in GitHub Desktop.
Rails caching strategy
// The parameter for search-name should be sanitized in some way of course
@api_result = Rails.cache.fetch("foursquare-#{search-name}") do
Foursquare.search(search-name)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment