首页 > 其他 > 详细

IIS7.5 GZip配置

时间:2015-11-04 19:11:05      阅读:219      评论:0      收藏:0      [点我收藏+]

默认情况下IIS7.5是启用gzip的,如果没启用,可以自行百度启用。

启用之后对javascript文件的压缩策略,有的是进行动态压缩,有的是进行静态压缩,建议统一改为静态压缩:

<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
            <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
            <staticTypes>
                <add mimeType="text/*" enabled="true" />
                <add mimeType="message/*" enabled="true" />
                <add mimeType="application/x-javascript" enabled="true" />
                <add mimeType="application/atom+xml" enabled="true" />
                <add mimeType="application/xaml+xml" enabled="true" />
                <add mimeType="*/*" enabled="false" />
            </staticTypes>
        </httpCompression>

 也就是将:

<add mimeType="application/x-javascript" enabled="true" />
这个节点放置在
<staticTypes>
节点下。
然后再网站的web.config文件中:
<system.webServer>
节点下添加:
<serverRuntime frequentHitThreshold="1" frequentHitTimePeriod="00:01:00" />
这个配置的作用是将IIS的频繁访问策略定为1分钟
然后再修改:
applicationHost.config
文件下的节点:
<section name="serverRuntime" overrideModeDefault="Deny" />
改为:
<section name="serverRuntime" overrideModeDefault="Allow" />
如果不进行这个修改,在webconfig中的修改将会报错。

参考自:http://www.cnblogs.com/KevinYang/archive/2010/06/02/1749675.html

IIS7.5 GZip配置

原文:http://www.cnblogs.com/Pure-Land/p/4936744.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!