设置在asp.net gzip的COM pression

问题描述:

有没有一种方法来设置gzip的COM pression在web.config中级别或我只能这样做在IIS管理控制台?

Is there a way to set the gzip compression at the web.config level or can I only do this in the IIS management console?

下面试试这个:约400%%的加速我的网站了。曾在第一次尝试。

Here try this: Sped my site up by about 400% percent. Worked on first try.

Activate用的GZip web.config中

<system.webServer>
  <httpCompression directory="%SystemDrive%\inetpub\
temp\IIS Temporary Compressed Files">
    <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
    <dynamicTypes>
      <add mimeType="text/*" enabled="true"/>
      <add mimeType="message/*" enabled="true"/>
      <add mimeType="application/javascript" enabled="true"/>
      <add mimeType="*/*" enabled="false"/>
    </dynamicTypes>
    <staticTypes>
      <add mimeType="text/*" enabled="true"/>
      <add mimeType="message/*" enabled="true"/>
      <add mimeType="application/javascript" enabled="true"/>
      <add mimeType="*/*" enabled="false"/>
    </staticTypes>
  </httpCompression>
  <urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer>