我刚刚开始使用Dalli gem进行内存缓存。
我只是想知道,如果我想从缓存中获取一些数据,我是否需要在每个请求中创建一个Dalli::Client的实例,或者我是否可以声明一个可以重用的单例?
发布于 2014-03-19 13:47:53
在你的config/environments/production.rb中
config.cache_store = :dalli_store
config.cache_store = :dalli_store,'cache-1.example.com',{ :namespace => NAME_OF_RAILS_APP,:expires_in => 1.day,:compress => true }
https://stackoverflow.com/questions/15026188
复制相似问题