mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Fix cache-control
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user