diff options
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/application.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index b923fedab7..0e85e6d1d5 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -147,9 +147,11 @@ module Rails def default_middleware_stack ActionDispatch::MiddlewareStack.new.tap do |middleware| - require "action_dispatch/http/rack_cache" if config.action_dispatch.rack_cache + rack_cache = config.action_controller.perform_caching && config.action_dispatch.rack_cache - middleware.use ::Rack::Cache, config.action_dispatch.rack_cache if config.action_dispatch.rack_cache + require "action_dispatch/http/rack_cache" if rack_cache + + middleware.use ::Rack::Cache, rack_cache if rack_cache middleware.use ::ActionDispatch::Static, config.static_asset_paths if config.serve_static_assets middleware.use ::Rack::Lock if !config.allow_concurrency middleware.use ::Rack::Runtime |