Created
March 19, 2015 08:16
-
-
Save D-system/de02cee13dd92932a1bd to your computer and use it in GitHub Desktop.
Expires any page in any situation (including the back button action)
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
def expires_now | |
# override default method due to some browsers cases (http://stackoverflow.com/a/18516720/856151) | |
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate' # HTTP 1.1. | |
response.headers['Pragma'] = 'no-cache' # HTTP 1.0. | |
response.headers['Expires'] = '0' # Proxies. | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment