5

Is their anyway to make httpCompression work from inside web.config ?

i try to add this in my web.config but it's does nothing :

<httpCompression>
  <dynamicTypes>
    <clear />
    <add mimeType="text/*" enabled="true" />
    <add mimeType="application/json" enabled="true" />    
    <add mimeType="application/javascript" enabled="true" />
    <add mimeType="*/*" enabled="false" />
  </dynamicTypes>
  <staticTypes>
    <clear />
    <add mimeType="text/*" enabled="true" />
    <add mimeType="application/javascript" enabled="true" />
    <add mimeType="*/*" enabled="false" />
  </staticTypes>
</httpCompression> 
zeus
  • 12,173
  • 9
  • 63
  • 184

1 Answers1

6

Overriding compression related settings in web.config is considered a new addition in IIS 10,

https://blogs.msdn.microsoft.com/friis/2017/09/05/iis-dynamic-compression-and-new-dynamic-compression-features-in-iis-10/

So to answer your question, you have to upgrade to IIS 10.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • I'm using IIS 10 and it still doesn't work, with `
    `
    – Maxim Mazurok Jul 06 '21 at 06:12
  • I'm trying to remove brotli like this: ` ` but it still usesbrotli even after `net stop was /y && net start w3svc` – Maxim Mazurok Jul 06 '21 at 06:12
  • 1
    @MaximMazurok that's not surprising, as the whole discussion (either here or in the Microsoft employee blog post) only covers basic elements like `dynamicTypes`. It is possible that overriding `scheme` in `web.config` is ignored by IIS. – Lex Li Jul 06 '21 at 14:34
  • That makes sense... Could you please take a look at my question regarding this matter? https://stackoverflow.com/questions/68266508/how-to-disable-brotli-httpcompression-in-iis-10-on-the-site-web-config-level – Maxim Mazurok Jul 06 '21 at 15:12
  • 1
    @MaximMazurok yes, I saw that but I have nothing more to comment. You have to reach out to Microsoft. – Lex Li Jul 06 '21 at 15:49