I'm using ASP.NET MVC's built in bundling of both our CSS and javascript.
This bundles the CSS into a bundle called
/Content/allcss?v=b2tuMEFw5RyKcq1cIwQCy0z5sJ_hUCzkzORKUQzsdow1
and the javascript into
/bundles/identity?v=h8j2kTCIC9kJAFTNr9X5evhiqPEF4I0uEN0GydPQyxY1
To get gzip to work in IIS 7.5 locally, I didn't need to change my web.config at all - all I needed to do was enable static compression and dynamic compression on my website in IIS Manager. With that done I can see the response headers for the JS bundle:
/bundles/identity?v=h8j2kTCIC9kJAFTNr9X5evhiqPEF4I0uEN0GydPQyxY1
Content-Type: text/javascript; charset=utf-8
Content-Encoding: gzip
When this is deployed to our Azure A2 cloud service (web role), gzip is not working on the JS bundle. It IS working on the CSS bundle. I have remote desktopped to the Azure Web Role instances and can see that static and dynamic compression are enabled in IIS. However, the js bundle still doesn't have gzip compression. The response has the same Content-Type but no Content-Encoding header.
Content-Type: text/javascript; charset=utf-8
How can I enable gzip compression on the javascript bundle in an Azure Web role?
Update: I followed this post to enable Failed Request Tracing and found that IIS is logging
DYNAMIC_COMPRESSION_NOT_SUCCESS Reason NO_COMPRESSION_PROXY