From 2478bf7ec71cbd0299ff90e24857436adffc8258 Mon Sep 17 00:00:00 2001 From: Daniel Uber Date: Tue, 27 Apr 2021 08:30:50 -0500 Subject: [PATCH] Enable redis cache store in development (#13526) * Always setup redis cache store in development We need this for argument passing for the podcast episode create worker after 9973b7361e8936ecd95c938746093524ad56ff63 Do still disable action controller caching by default, but permit Rails.cache.write and Rails.cache.read to do the expected things between sidekiq processes. --- config/environments/development.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index d11f0cdfc..26ff83cb1 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -14,22 +14,20 @@ Rails.application.configure do # Show full error reports. config.consider_all_requests_local = true + DEFAULT_EXPIRATION = 1.hour.to_i.freeze + config.cache_store = :redis_cache_store, { url: ENV["REDIS_URL"], expires_in: DEFAULT_EXPIRATION } + # 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.action_controller.enable_fragment_cache_logging = true - DEFAULT_EXPIRATION = 1.hour.to_i.freeze - config.cache_store = :redis_cache_store, { url: ENV["REDIS_URL"], expires_in: DEFAULT_EXPIRATION } - 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 # Don't care if the mailer can't send.