FIX: properly specify default on no cache on all resources

This commit is contained in:
Sam
2016-11-15 17:00:28 +11:00
parent 5613c5f81a
commit 63d9d4f301
3 changed files with 9 additions and 0 deletions

View File

@ -45,6 +45,7 @@ class ApplicationController < ActionController::Base
before_filter :check_xhr
after_filter :add_readonly_header
after_filter :perform_refresh_session
after_filter :dont_cache_page
layout :set_layout
@ -64,6 +65,12 @@ class ApplicationController < ActionController::Base
refresh_session(current_user)
end
def dont_cache_page
if !response.headers["Cache-Control"] && response.cache_control.blank?
response.headers["Cache-Control"] = "no-store, must-revalidate, no-cache, private"
end
end
def slow_platform?
request.user_agent =~ /Android/
end