memcached +dalli
安装memcached sudo apt-get install memcached
安装后,系统默认会开启一个memcached 服务, 用sudo kill 关闭默认开启的memcached服务进程
开启 memcached服务 memcached start -m 1024 -l 127.0.0.1 -p 11211
安装Dalli sudo gem install Dalli
config/environments/produation.rb下配置
config.cache_store = :dalli_store, 'localhost:11322', { :namespace => "rails-xxx",
:expires_in=>1.day,
:compress => true }配置OK
查看memcached 状态 telnet 127.0.0.1 11211后,在输入stats
添加Action缓存,controller中使用,caches_action: action_name
清除Action缓存,controller中使用,expire_action :controller => :topn, :action => [:periphery], :format => :json
相关推荐
85590296 2020-07-22
郗瑞强 2020-08-16
jkzyx 2020-06-29
luotuo 2020-06-26
LinuxJob 2020-06-26
ol0 2020-06-26
清溪算法君老号 2020-06-25
86251043 2020-06-13
CSDN0BLOG 2020-06-09
ol0 2020-05-26
andyhuabing 2020-05-22
程序员俱乐部 2020-05-06
83530391 2020-05-05
ol0 2020-05-02
83530391 2020-04-09
85590296 2020-03-25
carolAnn 2020-03-07
大脸猫脸大 2020-03-03
ol0 2020-02-18