rails: racke::cache middleware cannot be deleted

Using rails 3.1.0.rc5. I’m not using any caching in my application but sometimes pages seem to get cached by the browser and so the users see an old version of the page. I think this is a bug itself, but I dont know how to reproduce it reliably 😦

As I dont’ want any caching at all I try to remove all related middlewares:

config.middleware.delete ActionDispatch::Head
config.middleware.delete Rack::ConditionalGet
config.middleware.delete Rack::ETag
config.middleware.delete Rack::Cache

All mentioned middlewares except “Rack::Cache” can be removed. Trying to remove it results in uninitialized constant Rack::Cache when booting the app.

I also wonder how to delete the middleware #ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x0000000527d3f0>

About this issue

  • Original URL
  • State: closed
  • Created 13 years ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments

It’s still unclear to me how to remove #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007fbceba2ea18> from the stack. Perhaps there is an API call to get the run-time object? (perhaps by manually iterating middlewares and checking type somehow)