make sprockets cache definition development-only

This commit is contained in:
Andreas Nedbal 2020-05-06 14:31:27 +02:00
parent 9961796e3b
commit d5d5c5eb19
1 changed files with 8 additions and 6 deletions

View File

@ -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.