Enable gzip compression in IIS
In 2025 this article is over ten years old and is likely out of date. Leaving it as a historical curiosity.
For an API I am building, I needed to enable Gzip compression in IIS Express for JSON and came across GZip response on IIS Express.
There are just two commands to run. This example is for IIS Express but the same commands work in IIS:
cd %PROGRAMFILES%IIS Express
appcmd set config -section:urlCompression /doDynamicCompression:true
appcmd set config /section:staticContent /+[fileExtension='.json',mimeType='application/json']
appcmd.exe set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/json',enabled='True']" /commit:apphost
Then, restart IIS or IIS Express afterwards. Gzip compression is very beneficial, and it lowered response sizes for JSON API requests dramatically, sometimes by greater than 50%.