config.gem 'SystemTimer', :version => '>= 1.1.3', :lib => 'system_timer'
config.gem 'sanitize'
config.gem 'i18n', :version => '>= 0.5.0'
+ if defined?(MEMCACHE_SERVERS)
+ config.gem 'memcached'
+ end
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named
# config.logger = SyslogLogger.new
# Use a different cache store in production
-# config.cache_store = :mem_cache_store
+if defined?(MEMCACHE_SERVERS)
+ MEMCACHE = Memcached::Rails.new(MEMCACHE_SERVERS, :binary_protocol => true)
+ config.cache_store = :mem_cache_store, MEMCACHE
+end
# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
--- /dev/null
+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