1

Strangely I read tons of posts regarding the exact problem and many resolutions with it, but couldn't figure this out. So please read the following just to clarify what my problem is and what I have done so far to resolve the issue.

Problem : Unable to use dynamic compression for the xhr responses from my webservice hosted in an azure web role (instance has IIS 7.0), although javascript files (using mime type text/javascript) and aspx pages are properly loaded with gzip compression.

Environment : A medium azure instance running IIS 7.0

What I have tried and verified to resolve the issue

  • Make sure Azure CDN is disabled ( enabling azure cdn will disallow compression for xhr and this has to be resolved using different means. For instance by writing a custom web resource handler as explained here Azure CDN - Enabling HTTP Compression - Hosted Web Role ) (Done)
  • Make sure that the right applicationHost.config file is being targeted for editing if you're doing it manually. For instance on an IIS 7.0 running on 64-bit your applicationHost.config file would be located at %windir%\SYSWOW64\inetsrv\config and not in %windir%\System32\inetsrv\config folders. (Done)
  • Make sure dynamic compresion is enabled at IIS Server level and website level via IIS 7.0 (Done)
  • Verify that the applicationhost.config also has dynamic compression enabled. (Done)
  • Verify that appropriate mime types are used for compression. (Done) I have used the following mime types.
    • add mimeType="application/json" enabled="true"
    • add mimeType="application/json; charset=utf-8" enabled="true"
  • Verify that the size of the response meets the set threshold of the size of data that requires compression. (Done)
  • Recycle the application pool once the applicationhost.config file is edited for changes to httpCompression to take effect. (Done)
  • Verify that there's enough space on the directory where temporary files are created for compression. (Space available)
  • Verify that failed request logs do not show disabled compression errors. (No failed requests logged).

I guess the above ought to cover what I have tried and tested so far. Most people seem to have had issues related to the mime type but mine doesn't seem to be it.

Any suggestions or procedures that might help me sort this issue are welcome.

UPDATE : Added new step for verification. Please refer to step number 02 (Edited on 07/19/2012)

Community
  • 1
  • 1
TWickz
  • 622
  • 6
  • 13
  • Have you examined the Content-Type of the XHR response using Fiddler? With IIS 7.0, the compression mimeType needs to match the XHR Content-Type exactly. For example, application/json;charset=utf-8 (no space) will not match application/json; charset=utf-8 (with space) – Jonathan McIntire Jul 10 '12 at 16:56
  • @JonathanMcIntire - I did observe the content-type,not with Fiddler but using Firebug. And I copy pasted what I got 'exactly' onto the mimeType :) – TWickz Jul 10 '12 at 17:52
  • Is the XHR request being made to a WCF endpoint? – Jonathan McIntire Jul 10 '12 at 18:53
  • Just a regular asmx webservice. I am using Spring.NET just in case it helps. – TWickz Jul 11 '12 at 02:49
  • I've run into situations where the WCF endpoint configuration clobbers dynamic compression (DC). From what I can tell, you've already performed the obvious DC configuration tasks. Your only option might be to create a simple project with an asmx webservice in it. Once you get DC working in the new project, you can try adding portions of your main project until DC fails. That's what I did to figure out my WCF DC failure woes. – Jonathan McIntire Jul 11 '12 at 04:06
  • I forgot to ask...does dynamic compression work locally? If so, what version of IIS are you using locally? – Jonathan McIntire Jul 11 '12 at 04:07
  • Actually I didn't try this on the local IIS Server. I'll try it out and get back to you. – TWickz Jul 11 '12 at 04:31
  • @JonathanMcIntire - Hi Jonathan, Sorry for taking sometime to get back to you. I tried this on the local IIS server like you advised. Still no luck. Additionally I checked if I was editing the right applicationHost.config file because I figured out the file seems to be in two different locations and each used seperately depending on platform I think. – TWickz Jul 19 '12 at 15:58
  • The only thing I can think of at this point is to try to get dynamic compression working in a simple project with an asmx webserivce. – Jonathan McIntire Jul 20 '12 at 21:21
  • @JonathanMcIntire That's what I should probably try at this moment. Expose a simple service and try to get dynamic compression working for it. Then test the entire project service by service, webmethod by webmethod. – TWickz Jul 21 '12 at 04:39

0 Answers0