Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to enable dynamic compression for the mime type application/json.

In applicationHost.config, I've made the following change:

<section name="httpCompression" allowDefinition="AppHostOnly" overrideModeDefault="Allow" />

I also tried unlocking the section with the following command:

appcmd unlock config /section:system.webserver/httpcompression

My web.config settings (same as applicationHost.config but with additional mimetype):

    <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
        <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
            <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" />
            <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="*/*" enabled="false" />

But the response is not being gzipped. I know the settings are correct as it works if I add the mimetype directly to applicationHost.config.

I've enabled Failed Request Tracing and no errors are produced.

share|improve this question
can u also try to add this under system.webServer node: <urlCompression doStaticCompression="true" doDynamicCompression="true" /> –  tugberk Sep 11 '12 at 10:11
Unfortunately this made no difference. Also, in IIS 7.5 the default value for doDynamicCompression changed to true. –  Ben Sep 11 '12 at 10:19
do your changes work in IIS Express? –  tugberk Sep 11 '12 at 10:20
no, had to do the same thing (change applicationHost.config directly) –  Ben Sep 11 '12 at 11:41
Did you ever resolve this issue? –  Mario Sep 19 '12 at 17:58

1 Answer 1

Try also adding the mime type:

 <add mimeType="application/json; charset=utf-8" enabled="true" />
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.