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