第一步:打开IIS,启用>
右击“网站”->“属性”,选择“服务”。在“>
第二步:启用web服务
第三步:修改MetaBasexml
开始 > 运行中输入 c:\windows\system32\inetsrv,找到 MeteBasexml,先备份,在修改。(有的服务器不需要修改此文件便可以使用)
搜索 Location ="/LM/W3SVC/Filters/Compression/gzip"
仔细核对下代码:
<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/deflate"
HcCompressionDll="%windir%\system32\inetsrv\gzipdll"
HcCreateFlags="0"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="FALSE"
HcDynamicCompressionLevel="0"
HcFileExtensions="htm
html
txt"
HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="asp
dll
exe"
>
</IIsCompressionScheme>
<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/gzip"
HcCompressionDll="%windir%\system32\inetsrv\gzipdll"
HcCreateFlags="1"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="TRUE"
HcDynamicCompressionLevel="0"
HcFileExtensions="htm
html
txt"
HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="asp
dll
exe"
>
</IIsCompressionScheme>
替换成:
<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/gzip"
HcCompressionDll="%windir%\system32\inetsrv\gzipdll"
HcCreateFlags="1"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="TRUE"
HcDynamicCompressionLevel="10"
HcFileExtensions="html
css
js
htm
xml
txt"
HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="php
dll"
>
</IIsCompressionScheme>
<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/deflate"
HcCompressionDll="%windir%\system32\inetsrv\gzipdll"
HcCreateFlags="2"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="TRUE"
HcDynamicCompressionLevel="10"
HcFileExtensions="html
css
js
htm
xml
txt"
HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="php
dll"
>
</IIsCompressionScheme>
修改好以后,重启iis
然后在保存MeteBasexml,保存好后再启动IIS。这样Gzip压缩就启用成功了。
最后,测试Gzip压缩是否成功
gzip文件怎么打开另外,>
Apache >
欢迎分享,转载请注明来源:内存溢出
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)