5 06 2009

APACHE启用GZIP压缩优化

bigCat Posted in Linux - for Comments = 2

如果你想将压缩限制在几种特定的MIME类型上,可以使用AddOutputFilterByType指令。下面的例子仅仅允许对html、css、txt、php、js文档进行压缩:\r\n<IfModule mod_deflate.c>\r\nAddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-httpd-php application/x-javascript\r\n</IfModule>\r\n\r\n更详细的设置:http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_deflate.html\r\n\r\nmediatemple dv 设置\r\n\r\n#\r\n# Deflate output configuration\r\n#\r\nAddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-httpd-php application/x-javascript\r\nBrowserMatch ^Mozilla/4 gzip-only-text/html\r\nBrowserMatch ^Mozilla/4\.0[678] no-gzip\r\nBrowserMatch \bMSIE !no-gzip !gzip-only-text/html\r\n\r\n参考 http://kb.mediatemple.net/questions/1567/Compressing+web+pages+with+mod_deflate

  1. bigCat says:

    效果非常明显

  2. 你的博客真的很好!

Host: (miao) | Word: Press | Code: HTML5