压缩技术能有效的提高网站的访问速度,像起点等大型网站都启用了网页压缩技术,从某一方面来说对SEO还是有好处的,因为用户体验度高了
好了现在给大家介绍一下IIS下怎么做网页压缩技术
我用的是我的VPS实现的,打开IIS点网站-属性-服务,把压缩文件和压缩静态文件勾选上
然后我们在web服务扩展-添加一个web新服务
扩展名字叫做HTTP Compression
添加要求文件的地址在C:\WINDOWS\system32\inetsrv\gzip.dll
设置为允许状态哦,要不不管用的
然后我们用编辑器打开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="true"
HcDynamicCompressionLevel="9"
HcFileExtensions="htm
html
txt
js
css
swf
xml"
HcOnDemandCompLevel="9"
HcPriority="1"
HcScriptFileExtensions="asp
php
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
txt
js
css
swf
xml"
HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="asp
php
dll
exe"
>
</IIsCompressionScheme>
其中HcDynamicCompressionLevel=9是推荐最佳级别
HcFileExtensions是填写扩展名
HcScriptFileExtensions执行程序扩展名
然后我们必须关闭IIS服务 就在控制面板-服务-IIS Admin Service 点停止 然后才能更改文件MetaBase.xml
然后启动 打开网站测试就可以了
测试 http://tool.chinaz.com
欢迎大家转载 转载请注明来自微度网络http://yun.widuu.com
发表评论 取消回复