diff --git a/config/application.rb b/config/application.rb index 5797669c4..6032f943a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -61,9 +61,8 @@ module Zammad # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' - - + # Use a different cache store in production - config.cache_store = :file_store, 'tmp/cache/file_store' + config.cache_store = :file_store, 'tmp/cache/file_store' end end diff --git a/config/initializers/cache.rb b/config/initializers/cache.rb index 6f5dd270b..9ffa80a34 100644 --- a/config/initializers/cache.rb +++ b/config/initializers/cache.rb @@ -1,5 +1,7 @@ # clear cache -Rails.cache.clear +if Zammad::Application.config.cache_store[1] && File.directory?(Zammad::Application.config.cache_store[1]) + Rails.cache.clear +end # to get rails caching working, load models Dir.foreach("#{Rails.root}/app/models") do |model_name|