I have an ASP.NET Core 2.2 application that is running on Azure App Service.
The problem I have is that responses from the application are not being compressed (there is no Content-Encoding header).
My understanding of App Service is that my application will run Out of Process behind IIS, so IIS should be the thing that is in charge of compressing the response. My understanding is also that IIS on App Service should be configured to by default to compress file types like JavaScript and CSS automatically using gzip, however this does not happen.
The requests sent to the server all have the correct accept-encoding header, so it is not a problem with the browser (I have also checked using multiple browsers).
I have tried explicitly setting the urlCompression in web.config
:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
</system.webServer>
</location>
</configuration>
but that made no difference.
I also tried installing the IIS.Compression.SiteExtension to App Service, but that did not enable compression either.
I know that I could use Response Compression Middleware directly in my application, but I would prefer to have IIS handle it.
So my question, in short, is how do I get compression (either GZIP or Brotli) working for my application in App Service?