From d2912ff25f3bb76bec6bc5e465dbae9b82aca6e3 Mon Sep 17 00:00:00 2001 From: Mantas Date: Mon, 28 Oct 2019 12:12:10 +0200 Subject: [PATCH] Maintenance: Disable Rails default caching behavior because in memory cache leads to diverging cache state in multiple processes and no-cache is usually not a desired behavior. --- config/environments/development.rb | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 0377d60ef..efbef4920 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -12,20 +12,21 @@ Rails.application.configure do # Show full error reports. config.consider_all_requests_local = true + # Commented out to ensure using file cache store as described in config/application.rb # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. - if Rails.root.join('tmp', 'caching-dev.txt').exist? - config.action_controller.perform_caching = true - - config.cache_store = :memory_store - config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{2.days.to_i}" - } - else - config.action_controller.perform_caching = false - - config.cache_store = :null_store - end + # if Rails.root.join('tmp', 'caching-dev.txt').exist? + # config.action_controller.perform_caching = true + # + # config.cache_store = :memory_store + # config.public_file_server.headers = { + # 'Cache-Control' => "public, max-age=#{2.days.to_i}" + # } + # else + # config.action_controller.perform_caching = false + # + # config.cache_store = :null_store + # end # Store uploaded files on the local file system (see config/storage.yml for options) # config.active_storage.service = :local