From b705eb39e2a89ad8d2802a4ede6c90fcfcd18f12 Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Mon, 28 Jun 2021 18:32:01 +0530 Subject: [PATCH] fix: Add missing Cache-Control headers in the production config (#2518) --- config/environments/production.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index c60fff3e6..fb6c124d8 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -21,6 +21,9 @@ Rails.application.configure do # Disable serving static files from the `/public` folder by default since # 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.headers = { + 'Cache-Control' => "public, max-age=#{1.year.to_i}" + } # Compress JavaScripts and CSS. # config.assets.js_compressor = :uglifier # config.assets.css_compressor = :sass