Rails session memcache config

hiveer · April 21, 2014 · 1915 hits

大概了解了下,rails4 要使用 memcached 的话需要用 gem dalli。然后配置比较模糊,所以来此处像大家求证下。希望大家能指正下问题所在,以及改善的方案。 /config/initializers/session_store.rb

QYBUser::Application.config.session_store ActionDispatch::Session::CacheStore, :expire_after => 20.minutes

/config/environments/production.rb[/config/environments/development.rb]

config.cache_store  = :dalli_store, nil, {:namespace => "QYBUser", :expires_in => 1.day, :compress => true}

然后在?/config/environment.rb 中初始化 memcache server

ENV["MEMCACHE_SERVERS"] = "192.168.1.189:11211:5, 192.168.1.199:11211:5"
No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.