|
|
|
@ -51,8 +51,16 @@ OpenProject::Application.configure do |
|
|
|
|
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. |
|
|
|
|
# config.action_dispatch.rack_cache = true |
|
|
|
|
|
|
|
|
|
# Disable Rails's static asset server (Apache or nginx will already do this). |
|
|
|
|
config.public_file_server.enabled = false |
|
|
|
|
# Enable Rails's static asset server when requested |
|
|
|
|
if OpenProject::Configuration.enable_internal_assets_server? |
|
|
|
|
config.public_file_server.enabled = true |
|
|
|
|
config.public_file_server.headers = { |
|
|
|
|
'Access-Control-Allow-Origin' => '*', |
|
|
|
|
'Access-Control-Allow-Methods' => 'GET, OPTIONS, HEAD', |
|
|
|
|
'Cache-Control' => 'public, s-maxage=31536000, max-age=15552000', |
|
|
|
|
'Expires' => "#{1.year.from_now.to_formatted_s(:rfc822)}" |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# Compress JavaScripts and CSS. |
|
|
|
|
config.assets.js_compressor = nil |
|
|
|
|