Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

httpCompression not work inside web.config

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> 
like image 797
zeus Avatar asked Mar 07 '18 14:03

zeus


People also ask

How do I enable text compression in IIS?

On the Server Roles page, expand Web Server (IIS), expand Web Server, expand Performance, and then select Static Content Compression and/or Dynamic Content Compression. Click Next. On the Select features page, click Next. On the Confirm installation selections page, click Install.

How do I enable GZip compression in IIS?

GZip Compression can be enabled directly through IIS. So we go to the “Turn Windows features on or off” and select “Dynamic Content Compression” and click the OK button. Now if we go back to IIS, we should see that the compression page has changed.


1 Answers

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.

like image 137
Lex Li Avatar answered Nov 22 '22 14:11

Lex Li