discourse/config/initializers/99-rack-cache.rb
Sam 3d647a4b41 remove rack cache, it has been causing trouble
instead implement an aggressive anonymous cache that is stored in redis
this cache is sitting in the front of the middleware stack enabled only in production
TODO: expire it more intelligently when stuff is created
2013-10-16 16:39:18 +11:00

13 lines
318 B
Ruby

require_dependency "middleware/anonymous_cache"
enabled = if Rails.configuration.respond_to?(:enable_anon_caching)
Rails.configuration.enable_anon_caching
else
Rails.env.production?
end
if enabled
Rails.configuration.middleware.insert 0, Middleware::AnonymousCache
end