<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[在nginx和apache中配置静态图片本地缓存,让本地浏览器缓存。及其与squit进行缓存的配置。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Thu, 15 Sep 2011 03:24:23 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	如今网站的图片越来越多在访问量大的时候 带宽也遇到一定的瓶颈 我们可以把一些不是经常更新的静态图片或css一类的东东缓存到访问者的本地机器上 在apache和nginx中配置静态图片本地缓存的操作步骤如下:<br/>apache:<br/><textarea name="code" class="html" rows="15" cols="100">
 &lt;virtualhost *:80&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DocumentRoot /www/img.loosky.net
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ServerName img.loosky.net
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ifmodule mod_expires.c&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExpiresActive On
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExpiresDefault&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;access plus 1 days&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExpiresByType image/gif&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;access plus 1 days&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExpiresByType image/jpeg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;access plus 1 days&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ifmodule&gt;
&lt;/virtualhost&gt;
</textarea><br/> <br/>nginx：<br/><textarea name="code" class="html" rows="15" cols="100">
 server&nbsp;&nbsp;&#123;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; listen&nbsp;&nbsp;80;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;server_name&nbsp;&nbsp;&nbsp;&nbsp; img.loosky.net;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/www/img.loosky.net;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location ~ &#92;.(gif&#124;jpeg)$ &#123;expires 1d;&#125;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;
</textarea><br/><br/>来源：http://loosky.net/?p=1856<br/><br/>背景：有时在nginx的前端再搭一个squit的缓存机器，为此会看到：X-Cache HIT&nbsp;&nbsp;web-cache-10421<br/>(squid中的X-Cache和X-Cache-Lookup的意义)<br/>http://tiandirensoon.iteye.com/blog/1282530<br/><br/>nginx的cache使用两例:<br/>&nbsp;&nbsp;&nbsp;&nbsp;建议将CAHCE部分添加HEADER信息,方便分析是否真的缓存:<br/>&nbsp;&nbsp;&nbsp;&nbsp;add_header X-Cache HIT-LT;<br/>添加的内容：<br/>&nbsp;&nbsp;&nbsp;&nbsp;add_header&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X-Cache&nbsp;&nbsp; HIT-LinuxTone;<br/><br/><br/>nginx的cache功能可以把URL及相关组合当作Key，用md5编码哈希后保存在硬盘上，配置灵活，功能好不亚于squid。<br/>下载：<br/>&nbsp;&nbsp;&nbsp;&nbsp;wget http://labs.frickle.com/files/ngx_cache_purge-1.1.tar.gz<br/>&nbsp;&nbsp;&nbsp;&nbsp;wget http://nginx.org/download/nginx-0.8.44.tar.gz<br/>编译：<br/>&nbsp;&nbsp;&nbsp;&nbsp;./configure &#92;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;--user=www&quot; &#92;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;--group=www&quot; &#92;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;--add-module=../ngx_cache_purge-1.1&quot; &#92;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;--prefix=/usr/local/nginx/&quot; &#92;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;--with-http_stub_status_module&quot; &#92;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;--with-http_ssl_module&quot; &#92;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;--with-md5=/usr/lib&quot; &#92;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;--with-sha1=/usr/lib&quot;<br/><br/>来自：http://bbs.linuxtone.org/thread-6875-1-1.html
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] 在nginx和apache中配置静态图片本地缓存,让本地浏览器缓存。及其与squit进行缓存的配置。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>