gzip的安装 参考本文 具体的mod文件安装参考上述,需要安装的mod文件为mod_deflate.c,mod_headers.c 配置文件如下,
<IfModule deflate_module>
SetOutputFilter DEFLATE
DeflateCompressionLevel 3
#Don't compress
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|gz?|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:pdf|avi|mov|mp3|mp4|rm)$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
#Dealing with proxy servers
<IfModule headers_module>
Header append vary User-Agent
</IfModule>
</IfModule>