From 7e951677862d9ff45a5a8c6c64892eae476f6428 Mon Sep 17 00:00:00 2001 From: Sam Simpson Date: Tue, 15 Nov 2022 14:19:01 +0000 Subject: [PATCH] Add option to use a temporary directory for page cache --- config/application.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/application.rb b/config/application.rb index fc79896ec..fc2a2d2a0 100644 --- a/config/application.rb +++ b/config/application.rb @@ -41,6 +41,9 @@ class Application < Rails::Application config.ga_universal_id = ENV.fetch("GA_UNIVERSAL_ID", "UA-UNSET") config.ga_secondary_id = ENV.fetch("GA_SECONDARY_ID", "UA-UNSET") + # Use temporary directory for page cache if filesystem is read-only + config.action_controller.page_cache_directory = File.join(ENV["TMPDIR"], "page_cache") if ENV.fetch("USE_TMPDIR_PAGE_CACHE", "false") == "true" + # Rotate SHA1 cookies to SHA256 (the new Rails 7 default) # TODO: Remove this after existing user sessions have been rotated # https://guides.rubyonrails.org/v7.0/upgrading_ruby_on_rails.html#key-generator-digest-class-changing-to-use-sha256