Rails session memcache config

hiveer · 2014年04月21日 · 1915 次阅读

大概了解了下,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"
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号