From 1120eccbfa07588a587c58d20437a274b05a4283 Mon Sep 17 00:00:00 2001 From: Matthew Ford Date: Thu, 9 May 2024 19:48:17 +0100 Subject: [PATCH 1/5] Update Gemfile.lock Add another platform --- Gemfile.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile.lock b/Gemfile.lock index 3a21903dfd..1c3cf5c28b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -705,6 +705,7 @@ GEM PLATFORMS arm64-darwin-21 arm64-darwin-22 + arm64-darwin-23 x86_64-darwin-21 x86_64-darwin-22 x86_64-darwin-23 From 6e18d309e29767cbca5a0e2df8a3f3ce8ea4ddb1 Mon Sep 17 00:00:00 2001 From: Matthew Ford Date: Thu, 9 May 2024 19:49:07 +0100 Subject: [PATCH 2/5] Update production.rb Removing old comments for AWS SES (prior to the Notify migration) --- config/environments/production.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 6f08dd6f63..ea6d43f687 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -93,9 +93,4 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false - - # AWS SES mail settings are in config/initializers/aws_ses.rb - - # configure the devise email layout - # config.to_prepare { Devise::Mailer.layout "mailer" } end From 8c744b61e33426fd590490ac7de0eab0347c0842 Mon Sep 17 00:00:00 2001 From: Matthew Ford Date: Thu, 9 May 2024 19:49:40 +0100 Subject: [PATCH 3/5] Update .gitignore Ignore vscode folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index eefbc6c429..a2f2e2dc98 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ yarn-debug.log* /yarn-error.log yarn-debug.log* .yarn-integrity +/.vscode From a4f39957db7fb95ecf850d07f92d24a65b85d07a Mon Sep 17 00:00:00 2001 From: Matthew Ford Date: Thu, 9 May 2024 19:50:20 +0100 Subject: [PATCH 4/5] Set cache-control headers on assets These are served by the CDN anyway, but we should set asset headers in the application. --- config/environments/production.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index ea6d43f687..b450743bda 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -21,6 +21,10 @@ # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. config.public_file_server.enabled = true # ENV['RAILS_SERVE_STATIC_FILES'].present? + config.public_file_server.headers = { + "Cache-Control" => "public, s-maxage=31536000, max-age=15552000", + "Expires" => 1.year.from_now.to_formatted_s(:rfc822), + } # Compress JavaScripts and CSS. config.assets.js_compressor = Uglifier.new(harmony: true) From c188132a673a196d69886ed4b4a52ec5cee39907 Mon Sep 17 00:00:00 2001 From: Matthew Ford Date: Thu, 9 May 2024 19:58:39 +0100 Subject: [PATCH 5/5] Set X-Accel-Redirect for assets --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index b450743bda..c05eead8cb 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -44,7 +44,7 @@ # Specifies the header that your server uses for sending files. # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX # Store uploaded files on the local file system (see config/storage.yml for options) config.active_storage.service = :local