I am hosting an ASP.NET Core application in IIS using Kestrel and the ASP.NET Core Server Hosting Bundle, and even though Dynamic Compression is enabled in IIS the responses are not returning back as compressed. Does anything need to be enabled within the application itself for dynamic compression to work or is there anything else within IIS that need to be enabled?
Adding the following to the web.config helped, as it appeared that application/json wasn't being compressed based on the default settings in IIS:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpCompression>
<dynamicTypes>
<add mimeType="application/json" enabled="true" />
</dynamicTypes>
</httpCompression>
</system.webServer>
</configuration>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With