简体   繁体   English

托管在Azure上的WebApi中的压缩

[英]Compression in WebApi hosted on Azure

My Web Api is hosted on AzureWebsites and exposed through Azure Api management. 我的Web Api托管在Azure网站上,并通过Azure Api管理公开。 I just wondering how the compression will be enabled in such scenario? 我只是想知道在这种情况下如何启用压缩? Will it be something on azurewebsites or it should be done through Api management portal and HOW? 是在azure网站上进行,还是应通过Api管理门户网站和HOW完成?

This should enable gzip on every IIS-compatible host: 这应该在每个与IIS兼容的主机上启用gzip:

<system.webServer>
    <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="application/*" enabled="true" />
        <add mimeType="*/*" enabled="false" />
      </dynamicTypes>
      <staticTypes>
        <add mimeType="text/*" enabled="true" />
        <add mimeType="application/*" enabled="true" />
        <add mimeType="*/*" enabled="false" />
      </staticTypes>
    </httpCompression>
    <urlCompression doStaticCompression="true" doDynamicCompression="true" />
</system.webServer>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM