<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[阿Tim日志]]></title> 
<link>https://atim.cn/index.php</link> 
<description><![CDATA[专业的php开发者.开发团队的带队人]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[阿Tim日志]]></copyright>
<item>
<link>https://atim.cn/post//</link>
<title><![CDATA[nginx 代理缓存的坑]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Tue, 23 Apr 2013 15:45:49 +0000</pubDate> 
<guid>https://atim.cn/post//</guid> 
<description>
<![CDATA[ 
	原来网站上一直使用nginx的代理缓存，确实能给服务器节省大量的性能。能将大部分的页面进行缓存，但最近一段时间，发现并没有像以前那样将文件进行缓存。在经过检查后，发现原来 proxy_cache是对头信息有限制的。<br/><br/><a href="http://wiki.nginx.org/HttpProxyModule#proxy_cache" target="_blank">http://wiki.nginx.org/HttpProxyModule#proxy_cache</a><br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">The cache depends on proxy buffers, and will not work if proxy_buffers is set to off.<br/><br/>The following response headers flag a response as uncacheable unless they are ignored:<br/>&nbsp;&nbsp;&nbsp;&nbsp;Set-Cookie<br/>&nbsp;&nbsp;&nbsp;&nbsp;Cache-Control containing "no-cache", "no-store", "private", or a "max-age" with a non-numeric or 0 value<br/>&nbsp;&nbsp;&nbsp;&nbsp;Expires with a time in the past<br/>&nbsp;&nbsp;&nbsp;&nbsp;X-Accel-Expires: 0 <br/></div></div><br/><br/>proxy_cache受几个因素影响：<br/>1，proxy_buffers必须启动，否则将不能使用缓存<br/>2，如果头信息存在以下的情况，缓存将会被忽略。<br/>&nbsp;&nbsp;&nbsp;&nbsp;有Set-Cookie<br/>&nbsp;&nbsp;&nbsp;&nbsp;Cache-Control的内容包含： "no-cache", "no-store", "private", or a "max-age" 是0<br/>&nbsp;&nbsp;&nbsp;&nbsp;Expires 设置的时间一个过期的时间<br/>&nbsp;&nbsp;&nbsp;&nbsp;X-Accel-Expires: 0 <br/><br/>经过分析，原来程序中有一个程序修改后，默认所有页面都会传出一个Set-Cookie的值，这个值引起页面一直没有行缓存。从而使用页面服务器一直很慢。
]]>
</description>
</item><item>
<link>https://atim.cn/post//#blogcomment</link>
<title><![CDATA[[评论] nginx 代理缓存的坑]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://atim.cn/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>