官方的这个文档我看了一下里面主要涉及的是srcache_store和srcache_fetch是否skip的问题,另外一个是设置gzip的时候会失效的问题。我按照如下方式设置,在cache中命中的时候依然会调用后端的fastcgi去访问,不知道这个是不是跟cache的内容有关,烦请您看一下:
location ~* ^/(pic|ap|tmp|img|glogo|mix).*\.(jpg|png|jpeg|gif)$ {
srcache_ignore_content_encoding on;
set $key '$uri';
srcache_fetch GET /memc $key;
srcache_store PUT /memc $key;
proxy_set_header Accept-Encoding "";
rewrite ^(.*)$ /index.php break;
root /home/lichaowang/service/image_webroot/program;
fastcgi_pass fastcgi;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
------------------ 原始邮件 ------------------
发件人: "agentzh"<age...@gmail.com>;
发送时间: 2013年2月2日(星期六) 凌晨3:49
收件人: "王利超"<xidi...@qq.com>;
抄送: "openresty"<openresty@googlegroups.com>;
主题: Re: 请教在使用srcache模块出现的问题
Hello!
On Fri, Feb 1, 2013 at 3:44 AM, 王利超 wrote:
> 最近在使用您编写的nginx的srcache模块时候遇到了一个问题,写入的cache不能够正确的被读取,每次重新会调用fastcgi去处理,这样的话nginx层的cache就相当于失效状态。期待您的回复。
>
请参见 ngx_srcache 官方文档中的 Trouble Shooting 一节:
http://wiki.nginx.org/HttpSRCacheModule#Trouble_Shooting
同时抄送给 openresty 中文邮件列表:http://openresty.org/#Community
强烈建议你加入此列表并在那里和我们交流这样的问题。谢谢合作!
Best regards,
-agentzh