From a53ad5bba37199047ba20194933e122bf6b0252f Mon Sep 17 00:00:00 2001 From: Nahum Wild Date: Thu, 15 Jan 2009 21:28:10 -0600 Subject: Added in a local per request cache to MemCacheStore. It acts as a buffer to stop unneccessary requests being sent through to memcache [#1653 state:resolved] Signed-off-by: Joshua Peek --- railties/lib/initializer.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'railties/lib/initializer.rb') diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 824d1d6096..b57c46e098 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -414,6 +414,9 @@ Run `rake gems:install` to install the missing gems. def initialize_cache unless defined?(RAILS_CACHE) silence_warnings { Object.const_set "RAILS_CACHE", ActiveSupport::Cache.lookup_store(configuration.cache_store) } + if RAILS_CACHE.class.name == "ActiveSupport::Cache::MemCacheStore" + configuration.middleware.insert_after(:"ActionController::Failsafe", ActiveSupport::Cache::MemCacheStore::LocalCache) + end end end -- cgit v1.2.3