<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "讓CentOS 4.4上的Apache 2支援網頁壓縮"]]></title>
		<link>https://forum.andowson.com/posts/list/20.page</link>
		<description><![CDATA[Latest messages posted in the topic "讓CentOS 4.4上的Apache 2支援網頁壓縮"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>讓CentOS 4.4上的Apache 2支援網頁壓縮</title>
				<description><![CDATA[ 網頁壓縮可以節省傳輸頻寬，同時也節省傳輸時間(不過如果加上CPU運算的時間可能會打點折） 
<br>
先檢查網站有沒有支援HTTP Compression 
<br>
[url]http://www.seoconsultants.com/tools/compression.asp[/url] 
<br>
如果沒有的話，Apache 2的[url=http://httpd.apache.org/docs/2.0/mod/mod_deflate.html]mod_deflate[/url]模組可幫我們完成這個任務 
<br>
由於CentOS 4.4 預設安裝的Apache 2已將安裝好mod_deflate.so，所以我們只要將下列的設定加到/etc/httpd/conf/httpd.conf即可 
<br>
[code] 
<br>
&lt;Location /&gt; 
<br>
 # Insert filter 
<br>
 SetOutputFilter DEFLATE 
<br>
<br>
 # Netscape 4.x has some problems... 
<br>
 BrowserMatch ^Mozilla/4 gzip-only-text/html 
<br>
<br>
 # Netscape 4.06-4.08 have some more problems 
<br>
 BrowserMatch ^Mozilla/4\.0[678] no-gzip 
<br>
<br>
 # MSIE masquerades as Netscape, but it is fine 
<br>
 # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 
<br>
<br>
 # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48 
<br>
 # the above regex won't work. You can use the following 
<br>
 # workaround to get the desired effect: 
<br>
 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html 
<br>
<br>
 # Don't compress images 
<br>
 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary 
<br>
<br>
 # Make sure proxies don't deliver the wrong content 
<br>
 Header append Vary User-Agent env=!dont-vary 
<br>
&lt;/Location&gt; 
<br>
[/code] 
<br>
重新啟動Apache，再到上面的網站檢查看看，如果出現Compressed (gzip)，就成功了。]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/12/14.page</guid>
				<link>https://forum.andowson.com/posts/preList/12/14.page</link>
				<pubDate><![CDATA[Sat, 6 Jan 2007 14:32:27]]> GMT</pubDate>
				<author><![CDATA[ andowson]]></author>
			</item>
	</channel>
</rss>