Enable dynamic compression for JSON in IIS 7.5
I am trying to enable compression of the JSON response sent by the Web API controller, but it doesn't work for some reason. I have covered many similar questions on the StackOverflow and Microsoft forums. So the dynamic compression module is set httpCompression
to applicationHost.config
be as follows:
As you can see, I have raised the values dynamicCompressionDisableCpuUsage
and dynamicCompressionEnableCpuUsage
. I also set urlCompression
to the following value in applicationHost
both web.config
:
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
The traceback of the failed request (as described here: https://stackoverflow.com/a/w/80998/ ) shows some hits for static compression, but nothing for dynamic compression.
Response sizes range from 800KB to 20MB. But none of them shrink.
The problem is that my local IIS 8 server with the same configuration is compressing everything, and I just ran out of ideas as to why the problem occurs. Maybe the problem is CPU usage? Can you check it? Apart from this, unfortunately, I have no assumptions.
source to share
You can try to set the hourHitThreshold parameter to 1 in your ApplicationHost.config (setting it on your webserver won't override AH afaik setting)
<serverRuntime frequentHitThreshold="1" />
One more thing is to check if Dynamic Compression is actually installed on your IIS 7.5 server. 2k8 has no default permission. http://www.iis.net/configreference/system.webserver/urlcompression
source to share