1、IIS里要设置HTTP头
2、C:/WINDOWS/system32/inetsrv/MetaBase.xml要设置
<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/deflate"
HcCompressionDll="%windir%/system32/inetsrv/gzip.dll"
HcCreateFlags="0"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="FALSE"
HcDynamicCompressionLevel="9"
HcFileExtensions="htm
html
shtml
txt
js
css"
HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="aspx
ascx
asmx
ashx
asp
dll
exe"
>
< /IIsCompressionScheme>
< IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/gzip"
HcCompressionDll="%windir%/system32/inetsrv/gzip.dll"
HcCreateFlags="1"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="TRUE"
HcDynamicCompressionLevel="9"
HcFileExtensions="htm
html
shtml
txt
js
css"
HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="aspx
ascx
asmx
ashx
asp
dll
exe"
>
< /IIsCompressionScheme>
注意 蓝色的这些值,一定要每行一个,排在一行,用空格隔开是不行的。
3、重启IIS
4、到中国站长网检测检测
http://tool.chinaz.com/Gzips/