Apache Gzip设置

本文介绍如何在Apache中配置mod_deflate模块以实现HTTP响应内容的压缩,提高网站加载速度。文中详细展示了http.conf中关于mod_deflate.so的配置示例,并说明了启用此模块的方法。

http.conf的设置

LoadModule deflate_module modules/mod_deflate.so 

<ifmodule mod_deflate.c>  
AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml  
DeflateCompressionLevel 9   
SetOutputFilter DEFLATE   
#DeflateFilterNote Input instream   
#DeflateFilterNote Output outstream   
#DeflateFilterNote Ratio ratio   
#LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate   
#CustomLog logs/deflate_log.log deflate   
</ifmodule> 
 

注意apache在编译的时候需要添加

 

--enable-deflate
通过Yslo的网络-》 所有查看到的信息

DateFri, 27 Nov 2009 02:52:02 GMT
ServerApache
VaryAccept-Encoding
Content-Encodinggzip
Content-Length12973
Content-Typetext/html; charset=utf-8
X-CacheMISS from ....
Proxy-Connectionkeep-alive

 

 

 

转载于:https://www.cnblogs.com/likwo/archive/2009/11/27/1611823.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值