Skip to content

Instantly share code, notes, and snippets.

@HansHauge
Created March 19, 2015 15:13
Show Gist options
  • Save HansHauge/222550c32d2fba3e24ef to your computer and use it in GitHub Desktop.
Save HansHauge/222550c32d2fba3e24ef to your computer and use it in GitHub Desktop.
Rails Fragment Caching - Dalli and Memcachier
# Use a different cache store in production.
# /config/environments/production.rb
config.cache_store = :dalli_store,
(ENV["MEMCACHIER_SERVERS"] || "").split(","),
{:username => ENV["MEMCACHIER_USERNAME"],
:password => ENV["MEMCACHIER_PASSWORD"],
:failover => true,
:socket_timeout => 1.5,
:socket_failure_delay => 0.2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment