I’m working on a project that uses the MVC4 WebAPI (RC). The responses are not gzip compressed (dynamic compression in IIS is enabled).
The responses from normal MVC controllers are compressed. Do I need a specific setting to enable gzip compression for WebAPI responses?
I could add a custom compression handler, but if possible, I would just like to use the built-in IIS compression.
BTW, I know this is almost a duplicate of Compress HTTP GET Response, however the accepted answer there doesn’t really answer my question.
Is dynamic compression enabled for mimetype
application/json; charset=utf-8? By default this is not enabled even if dynamic compression is enabled.To see if it is enabled, you can look in the
applicationhost.configfile under%windir%\System32\inetsrv\configin the section.You should not edit the file, instead use
appcmd.exeto change it like this: https://stackoverflow.com/a/7375645/243936