thank you very much,i understand,i will try it for web CDN<br><br><div><span class="gmail_quote">2007/5/7, Liang Jin <<a href="mailto:mywebadmin@gmail.com">mywebadmin@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>First of all, you need to configure Memcached daemon. In the config<br>file you showed, it is located at localhost:10000 .<br><br>So when a client visit your site, nginx will try this Memcached server<br>to fetch the key defined in $memcached_key. If the client requests
<br><a href="http://domain1.com/path1/file1.php">domain1.com/path1/file1.php</a><br><br>This URL would be the key in Memcached cache, that stores the HTML<br>cache file for that page.<br><br>If nginx cannot find the key in the Memcached cache, it will return an
<br>404 error, which in the config file will fallback to the backend<br>proxy.<br><br>The first time when a visitor views the page, it will always fallback<br>to the backend. At that time, you should add in your PHP code to store
<br>the HTML page in the Memcached with the correct key. So the next time,<br>the page will be served by nginx using the contents in the Memcached<br>cache.<br><br>Does it make sense? For PHP memcached client, you can use the official
<br>php-memcache module.<br><br>-Liang<br><br><br><br>On 5/6/07, 焦胜强 <<a href="mailto:jiaosq@mail.51.com">jiaosq@mail.51.com</a>> wrote:<br>> HI:<br>> how can use the memcached_module in php?<br>> can someone give a example?
<br>> I can not understand this configfile:<br>> ...<br>> upstream backend {<br>> server localhost:80;<br>> }<br>> ...<br>> location /memcached/ {<br>> internal;
<br>> ssi on;<br>> set $memuri $uri;<br>> set $memcached_key "$memuri";<br>> memcached_pass localhost:10000;<br>> error_page 404 =200 /memcached-miss$memuri;
<br>> }<br>> ...<br>> location /memcached-miss/ {<br>> internal;<br>> ssi on;<br>> rewrite ^/memcached-miss/(.*)$ /$1 break;<br>> proxy_set_header Host $host;
<br>> proxy_set_header X-Real-IP $remote_addr;<br>> proxy_pass <a href="http://backend">http://backend</a>;<br>> proxy_redirect off;<br>> }<br>
><br></blockquote></div><br><br clear="all"><br>-- <br>Best Regards<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>焦胜强<br>上海我要网络发展有限公司 运维部 <br>上海浦东新区峨山路91弄200号新鹏大厦2楼 邮编 200127 <br>Tel: +86(021)58815151-5160
<br>Fax: +86(021)50904695<br>QQ: 34849502<br>MSN: <a href="mailto:jsq_yy@hotmail.com">jsq_yy@hotmail.com</a> <br>Email: <a href="mailto:jiaosq@mail.51.com">jiaosq@mail.51.com</a> <br>Visit us: <a href="http://www.51.com">
http://www.51.com</a>