X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/696fbb4e16c13f8f86134ad5c029644a5277a373..2fd52ddf6024ebdbebf451524836e67f7b4f07a2:/config/initializers/memcached.rb diff --git a/config/initializers/memcached.rb b/config/initializers/memcached.rb new file mode 100644 index 000000000..03066a8ab --- /dev/null +++ b/config/initializers/memcached.rb @@ -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