zoukankan      html  css  js  c++  java
  • IIS7.5 GZip配置

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

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

    <httpCompression directory="%SystemDrive%inetpub	empIIS Temporary Compressed Files">
                <scheme name="gzip" dll="%Windir%system32inetsrvgzip.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
  • 相关阅读:
    (转载)构建public APIs与CORS
    SpringMVC 参数注入
    java删除文件夹
    idea 自动提示生成 serialVersionUID
    JSP自定义tag
    gradle中使用嵌入式(embedded) tomcat, debug 启动
    spring in action 4th --- quick start
    Date, TimeZone, MongoDB, java中date的时区问题
    spring boot 添加拦截器
    HTTP status code
  • 原文地址:https://www.cnblogs.com/Pure-Land/p/4936744.html
Copyright © 2011-2022 走看看