mirror of
https://github.com/discourse/discourse.git
synced 2024-12-18 16:13:45 +08:00
3d647a4b41
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
13 lines
318 B
Ruby
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
|
|
|