IIS7启用静态压缩

IIS7启用压缩的操做以下图:javascript

 

默认状况下IIS7是启用GZip压缩的,可是有时候咱们会发现谁然启用了压缩可是一些js和css文件仍然没有被压缩,这个时候须要修改一下IIS 的配置文件:css

在C:\Windows\System32\inetsrv\config文件夹下找到applicationhost.config文件,打开以后找到以下一节内容:java

<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/x-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>
将:
 <add mimeType="application/x-javascript" enabled="true" />
<add mimeType="text/css" enabled="true" />
加入到staticTypes节点,重启IIS。
相关文章
相关标签/搜索