【发布时间】:2016-01-05 14:25:23
【问题描述】:
我有一个接受来自网络应用程序的批处理请求的网络 API 服务。我已经在 web.config 中定义了要压缩的 mime 类型“multipart/*”,但响应没有被压缩。我不确定为什么它不能像正常的单个请求一样工作(不作为多部分/混合发送的压缩很好)。
<httpCompression>
<dynamicTypes>
<clear />
<add enabled="true" mimeType="text/*" />
<add enabled="true" mimeType="application/javascript" />
<add enabled="true" mimeType="application/json" />
<add enabled="true" mimeType="multipart/*" />
<add enabled="false" mimeType="*/*" />
</dynamicTypes>
<staticTypes>
<clear />
<add enabled="true" mimeType="text/*" />
<add enabled="true" mimeType="application/javascript" />
<add enabled="true" mimeType="application/json" />
<add enabled="true" mimeType="multipart/*" />
<add enabled="false" mimeType="*/*" />
</staticTypes>
</httpCompression>
实际的响应 mime 类型以“multipart/mixed”开头,但会根据附加的边界 id 而有所不同。
Content-Type:multipart/mixed; boundary="0bb00cbc-234a-4264-87dc-60109719e79f"
请求发送了一个 Accepted-Encoding 标头,所以我认为问题不存在我认为这与 IIS 匹配 mime 类型有关。
任何想法都会很棒!
谢谢,
乔恩
【问题讨论】:
标签: http iis compression asp.net-web-api