mirror of
https://github.com/discourse/discourse.git
synced 2024-12-18 21:18:34 +08:00
0e8914cee6
add oobgc rudimentary support
13 lines
358 B
Ruby
13 lines
358 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 !ENV['DISCOURSE_DISABLE_ANON_CACHE'] && enabled
|
|
Rails.configuration.middleware.insert 0, Middleware::AnonymousCache
|
|
end
|
|
|