mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 19:08:10 -05: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
12 lines
318 B
Ruby
12 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
|
|
|