Skip to content

Instantly share code, notes, and snippets.

@andersonsp
Created December 9, 2013 19:04
Show Gist options
  • Save andersonsp/7878859 to your computer and use it in GitHub Desktop.
Save andersonsp/7878859 to your computer and use it in GitHub Desktop.
#
#add this to ApplicationController
#
def set_no_cache
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "0"
end
#
# add this to the controller you want to override cache settings
#
before_filter :set_no_cache, :only => [:index, :mine, :inbox, :show]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment