Created
January 27, 2020 06:01
-
-
Save abhianair/4f4631f67da46f1105ad99f1d7fa69a7 to your computer and use it in GitHub Desktop.
Avoiding caching the login page
This file contains hidden or 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
class ApplicationController < ActionController::Base | |
before_filter :set_cache_headers | |
private | |
def set_cache_headers | |
response.headers["Cache-Control"] = "no-cache, no-store" | |
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