Skip to content

Instantly share code, notes, and snippets.

@g3ortega
Created January 27, 2014 23:39
Show Gist options
  • Save g3ortega/8659689 to your computer and use it in GitHub Desktop.
Save g3ortega/8659689 to your computer and use it in GitHub Desktop.
Disable browser caching in Rails
before_filter :set_no_cache
#....
def set_no_cache
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment