Add memcache support
This commit is contained in:
parent
696fbb4e16
commit
2fd52ddf60
3 changed files with 16 additions and 1 deletions
9
config/initializers/memcached.rb
Normal file
9
config/initializers/memcached.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue