3

I'm trying to enable compression of a JSON response sent by Web API controller, but for some reason, it does not work. I have went through many similar questions on StackOverflow and Microsoft forums. So the Dynamic compression module is installed, the httpCompression in applicationHost.config is the following: Configuration editor

dynamicTypes

As you can, see I have raised the dynamicCompressionDisableCpuUsage and dynamicCompressionEnableCpuUsage values. I have also set urlCompression to the following value in both applicationHost and web.config to:

 <urlCompression doStaticCompression="true" doDynamicCompression="true" />

The Failed Request Tracing (like described here: https://stackoverflow.com/a/787251/829623) shows some hits for static compression, but nothing for dynamic compression.

The response sizes are varying from 800 KBs to 20 MBs. But none of them are compressed.

The problem here is that my local IIS 8 server with the same configuration compresses everything, and I've just run out of ideas why the issue happens. Maybe the problem is in CPU usage? Is it possible to check it? Other than this, I don't have any assumptions unfortunately.

Community
  • 1
  • 1
MyUserName
  • 495
  • 2
  • 6
  • 24
  • Could you please post the contents of your `%windir%\System32\inetsrv\config\ApplicationHost.config` file? – vzamanillo Dec 03 '14 at 17:19
  • Its possible that your request headers are not setup right. Is it possible for you to paste the request and response headers from your local IIS 8 and IIS 7.5? Also, enable IIS tracing for success status codes (200-399) which will give you more clue as to how that request is being handled and processed. – Mrchief Dec 03 '14 at 20:15
  • @vzamanillo: here it is: https://www.dropbox.com/s/7qr71e76qn4898v/applicationHost.config?dl=0 – MyUserName Dec 05 '14 at 07:35
  • @Mrchief: I have given up on trying to make this work. For my simple application, I don't neccessarily need to use compression in IIS, so I'm using application-level one now. IIS tracing didn't help as it showed nothing for dynamic compression. – MyUserName Dec 05 '14 at 07:36
  • What about the headers? I can understand your frustration, but I'm curious to see why this isn't working. – Mrchief Dec 05 '14 at 07:42

1 Answers1

0

You could try setting the frequentHitThreshold to 1 on your ApplicationHost.config (setting it on your web.config will not override the AH setting afaik)

<serverRuntime frequentHitThreshold="1" />

Another thing would be to check if Dynamic Compression is even installed on your IIS 7.5 server. 2k8 does not have it enabled by default. http://www.iis.net/configreference/system.webserver/urlcompression

  • As I mentioned, above, I have decided to use application'level compression instead. The dynamic compression is installed and enabled on both web server and web application. This didn't help though:). – MyUserName Dec 05 '14 at 07:37