【发布时间】:2012-04-17 08:16:48
【问题描述】:
我的托管服务器在共享托管环境中非常出色。 由于共享主机环境,我无法访问 IIS 设置。
出于多种目的,我向 ajax 请求发送 json 响应
我在 web.config 文件中设置了以下内容
<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="application/json" 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="application/json" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</staticTypes>
</httpCompression>
我可以对我的 .aspx 页面进行 gzip 压缩,但它不会压缩 json 响应。 如何压缩 json 响应..??
【问题讨论】:
-
真的..? 1年多了,没有任何反应。
标签: asp.net json iis web-config gzip