码迷,mamicode.com
首页 > Web开发 > 详细

Apache 开启压缩传输

时间:2015-06-06 13:18:38      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

在 /etc/httpd/conf/httpd.conf 中添加如下配置:

技术分享
# Enable gzip - by Jerryhuang  
#  
<IfModule mod_deflate.c>  
    SetOutputFilter DEFLATE  
    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|mov|avi|mp3|mp4|rm)$ no-gzip dont-vary  
   
    AddOutputFilterByType DEFLATE text/*  
    AddOutputFilterByType DEFLATE application/ms* application/vnd* application/postscript application/javascript application/x-javascript  
    AddOutputFilterByType DEFLATE application/x-httpd-php application/x-httpd-fastphp  
    BrowserMatch ^Mozilla/4 gzip-only-text/html  
    BrowserMatch ^Mozilla/4.0[678] no-gzip  
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html  
</IfModule>
Apache_Mod_deflate

参考网页:http://www.t086.com/code/apache2.2/mod/mod_deflate.html

检查网站是否已经开启压缩传输:http://tool.chinaz.com/Gzips/

Apache 开启压缩传输

标签:

原文地址:http://www.cnblogs.com/Mrhuangrui/p/4556453.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!