title: IIS 7.5 ASP.NET-4 Gzip compression
body: <p>I just can't seem to get GZIP compression enabled for my ASP.NET 4 application. Only javascript files seem to get compressed. The page, css and others dont get compressed.</p>
  
  <p>The response header of a not compressed CSS file is:</p>
  
  <pre><code>Content-Type      text/css
  Last-Modified     Mon, 09 Aug 2010 20:10:34 GMT
  Accept-Ranges     bytes
  Etag               "5d71bdecfe37cb1:0"
  Server    Microsoft-IIS/7.5
  Date               Sat, 28 Aug 2010 14:33:56 GMT
  Content-Length    3364
  </code></pre>
  
  <p>And for a Javascript file that gets compressed (scriptresource.axd):</p>
  
  <pre><code>Cache-Control      public
  Content-Type       application/x-javascript
  Content-Encoding gzip
  Expires    Sun, 28 Aug 2011 14:33:50 GMT
  Last-Modified      Sat, 28 Aug 2010 14:33:50 GMT
  Server     Microsoft-IIS/7.5
  Date                Sat, 28 Aug 2010 14:33:56 GMT
  Content-Length     478
  </code></pre>
  
  <p>In applicationHost.config:</p>
  
  <pre><code>    &lt;httpCompression sendCacheHeaders="false" directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" noCompressionForRange="true"&gt;
          &lt;scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /&gt;
          &lt;staticTypes&gt;
          &lt;/staticTypes&gt;
          &lt;dynamicTypes&gt;
          &lt;/dynamicTypes&gt;
      &lt;/httpCompression&gt;
  </code></pre>
  
  <p>And in the app web.config:</p>
  
  <pre><code>&lt;urlCompression  doStaticCompression="true" doDynamicCompression="true" dynamicCompressionBeforeCache="true" /&gt;
  &lt;httpCompression noCompressionForRange="false" noCompressionForHttp10="false" noCompressionForProxies="false" &gt;
    &lt;dynamicTypes&gt;
      &lt;add mimeType="text/css" enabled="true" /&gt;
    &lt;/dynamicTypes&gt;
    &lt;staticTypes&gt;
      &lt;add mimeType="text/css" enabled="true" /&gt;
    &lt;/staticTypes&gt;
  &lt;/httpCompression&gt;
  </code></pre>
  
  <p>Can anybody tell me what setting I am missing?</p>