<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dominic.Xu&#039;s 博客 &#187; apache</title>
	<atom:link href="http://xuplus.com/article/tag/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://xuplus.com</link>
	<description>Web 2.0 生活</description>
	<lastBuildDate>Wed, 24 Aug 2011 05:26:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>配置Apache2启用mod_expires模块给文件添加Expires头</title>
		<link>http://xuplus.com/article/2007/07/a51.html</link>
		<comments>http://xuplus.com/article/2007/07/a51.html#comments</comments>
		<pubDate>Fri, 27 Jul 2007 13:17:45 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[Web应用]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[expires]]></category>
		<category><![CDATA[http头]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=51</guid>
		<description><![CDATA[使用YSlow发现所在服务器上传输出来的文件Expires头都置为Expires: Thu, 19 Nov 1981 08:52:00 GMT了，非常奇怪的一个时间（莫非apache或者php某个开发人员是这个时候出生的），YSlow给出了加载expires模块的建议。 加载expires模块之后，编辑httpd.conf加入如下配置： # enable expirations ExpiresActive On # expire GIF images after a day from the time they were accessed ExpiresByType image/gif image/jpg A86400 # HTML documents are good for a hour from the  the time they were accessed ExpiresByType text/html M3600 # expire all default from the time they were [...]]]></description>
			<content:encoded><![CDATA[<p>使用YSlow发现所在服务器上传输出来的文件Expires头都置为Expires: Thu, 19 Nov 1981 08:52:00 GMT了，非常奇怪的一个时间（莫非apache或者php某个开发人员是这个时候出生的），YSlow给出了加载expires模块的建议。</p>
<p>加载expires模块之后，编辑httpd.conf加入如下配置：</p>
<blockquote><p># enable expirations<br />
ExpiresActive On<br />
# expire GIF images after a day from the time they were accessed<br />
ExpiresByType image/gif image/jpg A86400<br />
# HTML documents are good for a hour from the  the time they were accessed<br />
ExpiresByType text/html M3600<br />
# expire all default from the time they were accessed<br />
ExpiresDefault “A7200&#8243;</p></blockquote>

	标签： <a href="http://xuplus.com/article/tag/apache" title="apache" rel="tag">apache</a>, <a href="http://xuplus.com/article/tag/expires" title="expires" rel="tag">expires</a>, <a href="http://xuplus.com/article/tag/http%e5%a4%b4" title="http头" rel="tag">http头</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/07/a51.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>配置Apache2启用deflate压缩加快传输</title>
		<link>http://xuplus.com/article/2007/07/a50.html</link>
		<comments>http://xuplus.com/article/2007/07/a50.html#comments</comments>
		<pubDate>Fri, 27 Jul 2007 13:07:51 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[Web应用]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[deflate]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=50</guid>
		<description><![CDATA[今天下载了Yahoo的给Firefox开发的YSlow插件，这个插件确实不错，能够给出不少优化建议，发现所在主机没有开启deflate压缩。 首先加载mod_deflate。 在httpd.conf中加入 &#60;Location /&#62; # Insert filter SetOutputFilter DEFLATE # Netscape 4.x has some problems&#8230; BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48 [...]]]></description>
			<content:encoded><![CDATA[<p>今天下载了Yahoo的给Firefox开发的YSlow插件，这个插件确实不错，能够给出不少优化建议，发现所在主机没有开启deflate压缩。</p>
<p>首先加载mod_<a href="http://xuplus.com/article/tag/deflate" class="st_tag internal_tag" rel="tag" title="标签 deflate 下的日志">deflate</a>。</p>
<p>在httpd.conf中加入</p>
<blockquote><p>&lt;Location /&gt;</p>
<blockquote><p># Insert filter<br />
SetOutputFilter DEFLATE</p>
<p># Netscape 4.x has some problems&#8230;<br />
BrowserMatch ^Mozilla/4 gzip-only-text/html</p>
<p># Netscape 4.06-4.08 have some more problems<br />
BrowserMatch ^Mozilla/4\.0[678] no-gzip</p>
<p># MSIE masquerades as Netscape, but it is fine<br />
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html</p>
<p># NOTE: Due to a bug in mod_setenvif up to <a href="http://xuplus.com/article/tag/apache" class="st_tag internal_tag" rel="tag" title="标签 apache 下的日志">Apache</a> 2.0.48<br />
# the above regex won&#8217;t work. You can use the following<br />
# workaround to get the desired effect:<br />
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html</p>
<p># Don&#8217;t compress images<br />
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png|exe|bmp|mp3|rar|zip|swf|cab|t?gz|bz2|sit)$ no-gzip dont-vary<br />
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary</p>
<p># Make sure proxies don&#8217;t deliver the wrong content<br />
Header append Vary User-Agent env=!dont-vary</p></blockquote>
<p>&lt;/Location&gt;</p></blockquote>
<p>再重启apache即可，/etc/init.d/apache2 restart</p>
<p>经过port80software的在线检测，首页大小从91977 bytes压缩到13376 bytes，传输速度提高6.8X，传输速度从原来12.832 s缩减到1.866 s。</p>
<p>如果修改配置之后提示“Invalid command &#8216;Header&#8217;, perhaps mis-spelled or defined by a module not included in the server configuration”，则加载Header模块即可，不过最好还是在编译apache模块时直接加上&#8211;enable-deflate &#8211;enable-headers就省事多了。</p>

	标签： <a href="http://xuplus.com/article/tag/apache" title="apache" rel="tag">apache</a>, <a href="http://xuplus.com/article/tag/deflate" title="deflate" rel="tag">deflate</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/07/a50.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

