mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: properly specify default on no cache on all resources
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user