title: IIS7 GZIP Compression - httpCompression section
body: <p>I trying to configure <code>httpCompression</code> on IIS7. By googling, I found that it can be made using <code>httpCompression</code> section in config.  The problem, that I can't make it work from web.config.  </p>
  
  <p>When I make the configuration in <code>applicationHost.config</code> everything works as needed, but I want to be able to make this configuration per application and not globally.  </p>
  
  <p>I changed section definition in <code>applicationHost.config</code> to <code>&lt;section name="httpCompression" overrideModeDefault="Allow" /&gt;</code> and moved <code>httpCompression</code> section to web.config:</p>
  
  <pre><code>&lt;httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"&gt;
        &lt;scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /&gt;
        &lt;staticTypes&gt;
          &lt;add mimeType="text/*" enabled="true" /&gt;
          &lt;add mimeType="message/*" enabled="true" /&gt;
          &lt;add mimeType="application/x-javascript" enabled="true" /&gt;
          &lt;add mimeType="application/atom+xml" enabled="true" /&gt;
          &lt;add mimeType="application/xaml+xml" enabled="true" /&gt;
          &lt;add mimeType="*/*" enabled="false" /&gt;
        &lt;/staticTypes&gt;
        &lt;dynamicTypes&gt;
          &lt;add mimeType="text/*" enabled="true" /&gt;
          &lt;add mimeType="message/*" enabled="true" /&gt;
          &lt;add mimeType="application/x-javascript" enabled="true" /&gt;
          &lt;add mimeType="application/json" enabled="true" /&gt;
          &lt;add mimeType="application/json; charset=utf-8" enabled="true" /&gt;
          &lt;add mimeType="*/*" enabled="false" /&gt;
        &lt;/dynamicTypes&gt;
      &lt;/httpCompression&gt;  
  </code></pre>
  
  <p>What am I missing? It looks like IIS not reads compression configurations from web.config at all.</p>
  
  <p>After each change, I make application pool recycle, so it not a problem.</p>