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.
This commit is contained in:
parent
7c7a0992b7
commit
2478bf7ec7
1 changed files with 3 additions and 5 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue