If you need to disable the query cache in rails, it’s not particularly easy to do that.There is some discussion about it (dated March 2008) here.Although you can turn all caching off, and you can turn the query cache off explicitly in your code using uncached, there isn’t a way to turn just the query cache off globally at configuration time.So, then, here’s the monkey patch you need (tested on Rails 2.1.1). Although this is not particularly optimal (in that some query caching related code is still called), it will work. You can put this at the bottom of your environment.rb somewhere, or even better put it in its own file in the initializers directory (e.g. query_cached_off.rb).
module ActiveRecord module ConnectionAdapters module QueryCache private def cache_sql(sql) yield end end endend