fix: Add missing Cache-Control headers in the production config (#2518)
This commit is contained in:
parent
ac657e3bf9
commit
b705eb39e2
1 changed files with 3 additions and 0 deletions
|
@ -21,6 +21,9 @@ Rails.application.configure do
|
||||||
# Disable serving static files from the `/public` folder by default since
|
# Disable serving static files from the `/public` folder by default since
|
||||||
# Apache or NGINX already handles this.
|
# Apache or NGINX already handles this.
|
||||||
config.public_file_server.enabled = ActiveModel::Type::Boolean.new.cast(ENV.fetch('RAILS_SERVE_STATIC_FILES', true))
|
config.public_file_server.enabled = ActiveModel::Type::Boolean.new.cast(ENV.fetch('RAILS_SERVE_STATIC_FILES', true))
|
||||||
|
config.public_file_server.headers = {
|
||||||
|
'Cache-Control' => "public, max-age=#{1.year.to_i}"
|
||||||
|
}
|
||||||
# Compress JavaScripts and CSS.
|
# Compress JavaScripts and CSS.
|
||||||
# config.assets.js_compressor = :uglifier
|
# config.assets.js_compressor = :uglifier
|
||||||
# config.assets.css_compressor = :sass
|
# config.assets.css_compressor = :sass
|
||||||
|
|
Loading…
Reference in a new issue