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 &lt;<a href="mailto:mywebadmin@gmail.com">mywebadmin@gmail.com</a>&gt;:</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.&nbsp;&nbsp;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, 焦胜强 &lt;<a href="mailto:jiaosq@mail.51.com">jiaosq@mail.51.com</a>&gt; wrote:<br>&gt; HI:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; how can use the memcached_module in php?<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; can someone give a example?
<br>&gt; I can not understand this configfile:<br>&gt; ...<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; upstream&nbsp;&nbsp; backend {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; server&nbsp;&nbsp; localhost:80;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; ...<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location /memcached/ {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; internal;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssi on;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set&nbsp;&nbsp;&nbsp;&nbsp; $memuri $uri;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set&nbsp;&nbsp;&nbsp;&nbsp; $memcached_key&nbsp;&nbsp; &quot;$memuri&quot;;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; memcached_pass&nbsp;&nbsp;localhost:10000;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error_page 404 =200 /memcached-miss$memuri;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; ...<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location /memcached-miss/ {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; internal;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssi on;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rewrite&nbsp;&nbsp; ^/memcached-miss/(.*)$&nbsp;&nbsp;/$1 break;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_set_header&nbsp;&nbsp;&nbsp;&nbsp;Host&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $host;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_set_header&nbsp;&nbsp;&nbsp;&nbsp;X-Real-IP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$remote_addr;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_pass&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://backend">http://backend</a>;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_redirect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;off;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&gt;<br></blockquote></div><br><br clear="all"><br>-- <br>Best Regards<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>焦胜强<br>上海我要网络发展有限公司&nbsp;&nbsp;运维部&nbsp;&nbsp;&nbsp;&nbsp; <br>上海浦东新区峨山路91弄200号新鹏大厦2楼 邮编 200127 <br>Tel: +86(021)58815151-5160&nbsp;&nbsp;
<br>Fax: +86(021)50904695<br>QQ: 34849502<br>MSN: <a href="mailto:jsq_yy@hotmail.com">jsq_yy@hotmail.com</a>&nbsp;&nbsp;<br>Email: <a href="mailto:jiaosq@mail.51.com">jiaosq@mail.51.com</a>&nbsp;&nbsp;&nbsp;&nbsp;<br>Visit us: <a href="http://www.51.com">
http://www.51.com</a>