Created
October 4, 2011 06:50
-
-
Save minikomi/1261038 to your computer and use it in GitHub Desktop.
Eliminiate flash[:notice] or flash[:errors] being shown on back button by forcing non-cache of page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before do | |
if flash[:notice] || flash[:errors] | |
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 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment