慕容的工作随笔

慕容的工作随笔

记录学习和工作

apache mod_deflate模块优化网站速度

<ifmodule mod_deflate.c>
<location />
SetOutputFilter DEFLATE

AddOutputFilterByType DEFLATE text/html text/plain text/xml
AddOutputFilter DEFLATE css #压缩css文件
AddOutputFilter DEFLATE js #压缩js文件

#BrowserMatch ^Mozilla/4 gzip-only-text/html
#BrowserMatch ^Mozilla/4.0[678] no-gzip
#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html #针对不同浏览器的配置,这里用处不大

Don’t compress images #对照片文件不进行压缩处理

SetEnvIfNoCase Request_URI (?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI (?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .pdf$ no-gzip dont-vary
#SetEnvIfNoCase Request_URI .(css|js)$ no-gzip dont-vary

Make sure proxies don’t deliver the wrong content

Header append Vary User-Agent env=!dont-vary
</location>
</ifmodule>

评论 (0)

还没有评论,来做第一个吧。

发表评论

提交后需管理员审核通过后显示