I've been working on enabling JSON compression from one of our MVC3 sites. From various articles I've read it seems as though I should be able to set the application/json; charset=utf-8
MIME type in the applications web.config file. But doing so does not enable compression. But when added to the applicationhost.config file, it works. Am I missing something here?
My application web.config has the following added to it:
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<dynamicTypes>
<add mimeType="application/javascript; charset=utf-8" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="application/json; charset=utf-8" enabled="true" />
</dynamicTypes>
<staticTypes>
<add mimeType="application/javascript; charset=utf-8" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="application/json; charset=utf-8" enabled="true" />
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
The server is running Windows Server 2008 R2 with IIS7.5. I've also installed & enabled Dynamic Compression for the site in question.
Any help would be greatly appreciated, as I do not wish to enable JSON compression for the entire server.