diff --git a/config/environments/development.rb b/config/environments/development.rb index 765209d1a..084add8e0 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -20,8 +20,11 @@ config.action_controller.perform_caching = true if ENV["REDIS_CACHE_URL"] - config.cache_store = :redis_cache_store, { url: ENV.fetch("REDIS_CACHE_URL", nil) } - config.session_store(:cache_store, key: "decidim_session") + config.cache_store = :redis_cache_store, { + url: ENV.fetch("REDIS_CACHE_URL", nil), + expires_in: ENV.fetch("REDIS_CACHE_EXPIRES_IN", 60.minutes).to_i + } + config.session_store(:cache_store, key: "decidim_session", expire_after: Decidim.config.expire_session_after) else config.cache_store = :memory_store end diff --git a/config/environments/production.rb b/config/environments/production.rb index 64c4bb6ec..5ca1bf212 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -51,8 +51,11 @@ # Use a different cache store in production. # config.cache_store = :mem_cache_store - config.cache_store = :redis_cache_store, { url: ENV.fetch("REDIS_CACHE_URL", nil) } - config.session_store(:cache_store, key: "decidim_session") + config.cache_store = :redis_cache_store, { + url: ENV.fetch("REDIS_CACHE_URL", nil), + expires_in: ENV.fetch("REDIS_CACHE_EXPIRES_IN", 60.minutes).to_i + } + config.session_store(:cache_store, key: "decidim_session", expire_after: Decidim.config.expire_session_after) # Use a real queuing backend for Active Job (and separate queues per environment) # config.active_job.queue_adapter = :resque