Is there a way to set the gzip compression at the web.config level or can I only do this in the IIS management console?
Check the httpCompression TypesCheck the httpCompression section in applicationHost. config file, you should find <add mimeType="application/x-javascript" enabled="true" /> . If this is correct, then it should be correctly configured in your IIS. This will start compressing your .
Then use the following class at the method level as in the following: . Execute the Web API method by commenting the DeflateCompression attribute that is applied on the Web API controller method, you will find that returned data is not compressed but simple JSON. See the execution time when compression is not applied.
Here try this: Sped my site up by about 400% percent. Worked on first try.
Activate GZip with web.config
<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="message/*" enabled="true"/> <add mimeType="application/javascript" enabled="true"/> <add mimeType="*/*" enabled="false"/> </dynamicTypes> <staticTypes> <add mimeType="text/*" enabled="true"/> <add mimeType="message/*" enabled="true"/> <add mimeType="application/javascript" enabled="true"/> <add mimeType="*/*" enabled="false"/> </staticTypes> </httpCompression> <urlCompression doStaticCompression="true" doDynamicCompression="true"/> </system.webServer>
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