summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-07-11 17:51:11 -0700
committerelijah <elijah@riseup.net>2013-07-11 17:51:11 -0700
commite7ee261680e42e99d7a5ee2e91987bf92d99b3a4 (patch)
tree265473e735d84871c3f4cfcf81ef7c44d3b9abbb /app/controllers
parentb6b336d9f96c0618885b587ebb2b4d85a9381afb (diff)
set no-cache headers in the response
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/application_controller.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 62d9df2..65d4861 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,5 +1,6 @@
class ApplicationController < ActionController::Base
protect_from_forgery
+ before_filter :no_cache_header
ActiveSupport.run_load_hooks(:application_controller, self)
@@ -15,4 +16,13 @@ class ApplicationController < ActionController::Base
end
helper_method :bold
+ #
+ # we want to prevent the browser from caching anything, just to be safe.
+ #
+ def no_cache_header
+ response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
+ response.headers["Pragma"] = "no-cache"
+ response.headers["Expires"] = "0"
+ end
+
end