Hello!
Encountered in the use of memc such a problem, I do not know how to
solve. In the nginx configuration file and php file using memc, can be
normal cache. However, if the cache of php file include jump statement,
such as @header, then jump failure. How to solve this problem?
nginx.conf
server {
…
location ~ /async/(.*) {
set_md5 $md5
$host$request_uri;
set $memc_key $md5;
memc_pass memcbackend;
memc_flags_to_last_modified on;
memc_connect_timeout 30s;
memc_send_timeout 30s;
memc_read_timeout 30s;
access_log off;
expires max;
error_page 404 = /async/index.php?$query_string ;
}
…
}
php file /async/index.php
If the access address http://www.test.com/async/test.php
/async/ directory is not include test.phpd file, it will be 404
redirected to /async/ index.php, but the @header in /async/index.php
will not be effective.
How to solve this problem? Thank you very much!
Hello!
Encountered in the use of memc such a problem, I do not know how to
solve. In the nginx configuration file and php file using memc, can be
normal cache. However, if the cache of php file include jump statement,
such as @header, then jump failure. How to solve this problem?
Please do not abuse the error_page directive with ngx_memc to do
response caching; it’s problematic. I suggest you take a look at the
ngx_srcache module which can serve as a generic cache layer and can be
used safely with backend storage modules like ngx_memc:
http://wiki.nginx.org/HttpSRCacheModule
Regards,
-agentzh
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.