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.
This commit is contained in:
parent
67d3f35b05
commit
d2912ff25f
1 changed files with 13 additions and 12 deletions
|
@ -12,20 +12,21 @@ Rails.application.configure do
|
||||||
# Show full error reports.
|
# Show full error reports.
|
||||||
config.consider_all_requests_local = true
|
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.
|
# Enable/disable caching. By default caching is disabled.
|
||||||
# Run rails dev:cache to toggle caching.
|
# Run rails dev:cache to toggle caching.
|
||||||
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
# if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
||||||
config.action_controller.perform_caching = true
|
# config.action_controller.perform_caching = true
|
||||||
|
#
|
||||||
config.cache_store = :memory_store
|
# config.cache_store = :memory_store
|
||||||
config.public_file_server.headers = {
|
# config.public_file_server.headers = {
|
||||||
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
# 'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
||||||
}
|
# }
|
||||||
else
|
# else
|
||||||
config.action_controller.perform_caching = false
|
# config.action_controller.perform_caching = false
|
||||||
|
#
|
||||||
config.cache_store = :null_store
|
# config.cache_store = :null_store
|
||||||
end
|
# end
|
||||||
|
|
||||||
# Store uploaded files on the local file system (see config/storage.yml for options)
|
# Store uploaded files on the local file system (see config/storage.yml for options)
|
||||||
# config.active_storage.service = :local
|
# config.active_storage.service = :local
|
||||||
|
|
Loading…
Reference in a new issue