【发布时间】:2016-12-08 17:41:51
【问题描述】:
在 Windows Server 2012(标准)上的 IIS 8 上激活 Gzip 的问题
- 所以我在 windows 功能中激活了压缩
- 我在 IIS 中选中了两个复选框 - 压缩(动态和静态) 但仍然没有可用的 Gzip。但是,在我的 localhost 机器(只是一个 Windows 10)上,这是可行的。
我看到的是,当我通过服务器 localhost 浏览我的网站时,gzip 临时目录(C:\inetpub\temp\IIS 临时压缩文件)被填满。但奇怪的是,我在 chrome 中没有看到任何 Gzip-ped 内容。
唯一的标头(在 chrome 中)是:HTTP/1.1 304 未修改接受范围:字节 ETag:“0a354779de8d11:0”服务器:Microsoft-IIS/8.0 X-Powered-By:ASP.NET 日期:周四,格林威治标准时间 2016 年 7 月 28 日 13:41:04
(甚至 yslow 都说没有激活 gzip)
当我删除 gzip 临时文件夹并通过“官方”网站 url 浏览到该站点时,甚至什么都没有生成。
有人知道这里发生了什么吗?
我在我的 web.config 中添加了这个
<httpCompression>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="image/jpeg" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="image/jpeg" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" dynamicCompressionLevel="4" />
</httpCompression>
查看其他主题,我在其中激活了更多日志信息,Gzip not working, server 2012, IIS 8
我得到的是:
<RenderingInfo Culture="nl-BE">
<Opcode>STATIC_COMPRESSION_NOT_SUCCESS</Opcode>
<Keywords>
<Keyword>Compression</Keyword>
</Keywords>
<freb:Description Data="Reason">NO_MATCHING_SCHEME</freb:Description>
</RenderingInfo>
【问题讨论】:
标签: iis server compression gzip iis-8