标签:key ror test cal ring pac 域名 line page
1.nginx的配置如下:
location ^~ /images/ { set $memcached_key "$uri"; #用URI作为key去memcached中去读取内容 memcached_pass 127.0.0.1:11211; memcached_connect_timeout 5s; memcached_read_timeout 5s; memcached_send_timeout 5s; memcached_buffer_size 32k; error_page 404 502 504 = @fallback;}location @fallback { proxy_pass http://backend;}<?php$pic = file_get_contents(‘./test.jpg‘);$memcache = new Memcache;$memcache->connect(‘localhost‘, 11211);$memcache->add(‘/images/test.jpg‘, $pic, false, 0); //这里设置缓存不过期$memcache->close();标签:key ror test cal ring pac 域名 line page
原文地址:http://www.cnblogs.com/cocoqi/p/7088942.html