title: How to enable gzip HTTP compression on Windows Azure dynamic content
body: <p>I've been trying unsuccessfully to enable gzip HTTP compression on my Windows Azure hosted WCF Restful service which returns JSON only from GET and POST requests. </p>
  
  <p>I have tried so many things that I would have a hard time listing all of them, and I now realise I have been working with conflicting information (regarding old version of azure etc) so think it best to start with a clean slate!</p>
  
  <p>I am working with Visual Studio 2008, using the February 2010 tools for Visual Studio.</p>
  
  <p>So, according to the following <a href="http://msdn.microsoft.com/en-us/library/ff436045.aspx" rel="noreferrer">link</a>..</p>
  
  <p>.. HTTP compression has now been enabled. I've used the advice at the following page (the URL compression advice only).. </p>
  
  <p><a href="http://blog.smarx.com/posts/iis-compression-in-windows-azure" rel="noreferrer">http://blog.smarx.com/posts/iis-compression-in-windows-azure</a></p>
  
  <pre><code>&lt;urlCompression doStaticCompression="true" 
           doDynamicCompression="true"
           dynamicCompressionBeforeCache="true" 
  /&gt;
  </code></pre>
  
  <p>.. but I get no compression. It doesn't help that I don't know what the difference is between <strong>urlCompression</strong> and <strong>httpCompression</strong>. I've tried to find out but to no avail!</p>
  
  <p>Could, the fact that the tools for Visual Studio were released before the version of Azure which supports compression, be a problem? I have read somewhere that, with the latest tools, you can choose which version of Azure OS you want to use when you publish ... but I don't know if that's true, and if it is, I can't find where to choose. Could I be using a pre-http enabled version?</p>
  
  <p>I've also tried blowery http compression module, but no results. </p>
  
  <p>Does any one have any up-to-date advice on how to achieve this? i.e. advice that relates to the current version of the Azure OS.</p>
  
  <p>Cheers!</p>
  
  <p>Steven</p>
  
  <p><b>Update:</b> I edited the above code to fix a type in the web.config snippet.</p>
  
  <p><b>Update 2:</b> Testing the responses using the whatsmyip URL shown in the answer below is showing that my JSON responses from my service.svc are being returned without any compression, but static HTML pages <b>ARE</b> being returned with gzip compression. Any advice on how to get the JSON responses to compress will be gratefully received!</p>
  
  <p><b>Update 3:</b> Tried a JSON response larger than 256KB to see if the problem was due to the JSON response being smaller than this as mentioned in comments below. Unfortunately the response is still un-compressed.</p>