From d5d5c5eb1991d4f276bf19cc8b932c7a06ad9d04 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Wed, 6 May 2020 14:31:27 +0200 Subject: [PATCH] make sprockets cache definition development-only --- config/initializers/assets.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 75540cd5..bc49d7dd 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -1,11 +1,13 @@ # Be sure to restart your server when you modify this file. -Rails.application.config.assets.configure do |env| - env.cache = Sprockets::Cache::FileStore.new( - ENV.fetch("SPROCKETS_CACHE", "#{env.root}/tmp/cache/assets"), - Rails.application.config.assets.cache_limit, - env.logger - ) +unless Rails.env.production? + Rails.application.config.assets.configure do |env| + env.cache = Sprockets::Cache::FileStore.new( + ENV.fetch("SPROCKETS_CACHE", "#{env.root}/tmp/cache/assets"), + Rails.application.config.assets.cache_limit, + env.logger + ) + end end # Version of your assets, change this if you want to expire all your assets.