title: Enabling gzip compression on Azure Websites
body: <p>I have an ASP.NET application running on an azure website using the standard tier. I have been trying to get gzip compression working on it. I've modified my <code>web.config</code> file and added the following under <code>system.webServer</code></p>
  
  <pre><code>&lt;urlCompression doStaticCompression="true" doDynamicCompression="true"/&gt;
  &lt;httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"&gt;
      &lt;dynamicTypes&gt;
          &lt;add mimeType="text/*" enabled="true"/&gt;
          &lt;add mimeType="message/*" enabled="true"/&gt;
          &lt;add mimeType="application/javascript" enabled="true"/&gt;
          &lt;add mimeType="application/x-javascript" enabled="true"/&gt;
          &lt;add mimeType="*/*" enabled="false"/&gt;
      &lt;/dynamicTypes&gt;
      &lt;staticTypes&gt;
          &lt;add mimeType="text/*" enabled="true"/&gt;
          &lt;add mimeType="message/*" enabled="true"/&gt;
          &lt;add mimeType="application/javascript" enabled="true"/&gt;
          &lt;add mimeType="application/x-javascript" enabled="true"/&gt;
          &lt;add mimeType="*/*" enabled="false"/&gt;
       &lt;/staticTypes&gt;
  &lt;/httpCompression&gt;
  </code></pre>
  
  <p>This works when running locally with IIS express but does not work when deployed to azure. The response contains the following headers.</p>
  
  <pre><code>Accept-Ranges:bytes
  Content-Length:5381
  Content-Type:text/css
  Date:Fri, 04 Sep 2015 20:44:01 GMT
  ETag:"56386b2e88dad01:0"
  Last-Modified:Wed, 19 Aug 2015 14:06:02 GMT
  Server:Microsoft-IIS/8.0
  X-Powered-By:ASP.NET
  </code></pre>