Unable to enable gzip compression for XHR responses in Azure Web Role
===

Strangely I read tons of posts regarding the exact problem and many resolutions with it. 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 my xhr responses from my webservice hosted in an azure web role (instance has IIS 7.0). Javascript files (using mime type text/javascript) and aspx pages are properly loaded with gzip.

**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 http://stackoverflow.com/questions/10420004/azure-cdn-enabling-http-compression-hosted-web-role/10434390#10434390 ) (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.

        

 

 