Skip to content

Commit

Permalink
Merge pull request #2931 from alphagov/samsimpson1/page-cache-location
Browse files Browse the repository at this point in the history
Add option to use a temporary directory for page cache
  • Loading branch information
samsimpson1 authored Nov 15, 2022
2 parents aaa933a + 7e95167 commit 59404bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 59404bb

Please sign in to comment.