Created
June 26, 2012 15:35
-
-
Save jzajpt/2996464 to your computer and use it in GitHub Desktop.
Rails controllers - No caching
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_filter :set_caching_headers | |
def set_caching_headers | |
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" | |
response.headers["Pragma"] = "no-cache" | |
response.headers["Expires"] = "0" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment