Fix cache-control

This commit is contained in:
Oliver Günther
2017-01-17 16:40:58 +01:00
parent 0b0bbbbb7e
commit 1eaa71d8e1
2 changed files with 6 additions and 3 deletions
+5 -3
View File
@@ -132,9 +132,11 @@ class ApplicationController < ActionController::Base
# http://stackoverflow.com/questions/711418/how-to-prevent-browser-page-caching-in-rails
def set_cache_buster
if OpenProject::Configuration['disable_browser_cache']
response.headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
response.headers['Pragma'] = 'no-cache'
response.headers['Expires'] = 'Fri, 01 Jan 1990 00:00:00 GMT'
response.cache_control.merge!(
max_age: 0,
public: false,
must_revalidate: true
)
end
end
@@ -63,6 +63,7 @@ class CustomStylesController < ApplicationController
def logo_download
@custom_style = CustomStyle.current
if @custom_style && @custom_style.logo
expires_in 1.years, public: true, must_revalidate: false
send_file(@custom_style.logo_url)
else
head :not_found