Add memcache support

This commit is contained in:
Tom Hughes 2011-04-17 18:56:50 +01:00
parent 696fbb4e16
commit 2fd52ddf60
3 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,9 @@
if defined?(PhusionPassenger) and defined?(MEMCACHE_SERVERS)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
MEMCACHE = MEMCACHE.clone
RAILS_CACHE = ActiveSupport::Cache::CompressedMemCacheStore.new(MEMCACHE)
ActionController::Base.cache_store = RAILS_CACHE
end
end
end