【问题标题】:compressing json response from asp.net server in a shared hosting environment在共享托管环境中压缩来自 asp.net 服务器的 json 响应
【发布时间】: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


【解决方案1】:

我认为答案是您需要自己的 VPS 服务器(如果您有预算的话)或自己的专用服务器。然后你可以修改IIS7的applicationHost.config

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多