After following many posts and tutorials on properly setting up IIS dynamic compression for JSON responses, I was still reaching a dead end. For whatever reason, my responses were still uncompressed. Apparently, using the NetworkService account doesn’t always play nicely with static or dynamic content compression.
The NetworkService account doesn’t have permission to the IIS Temporary Compressed Files folder, preventing it from writing and reading out compressed streams. The easiest way to get around this is by adding the NetworkService account to the IIS_IUSRS group (which already has permissions to the IIS temporary folder).
- Open the Local Users and Groups management console
- Choose Groups from the sidebar
- Open the IIS_IUSRS property window
- Click Add, then enter Network Service as the user. Be sure to have your local workstation as the location, then check Check Names to be sure you entered everything correctly. Click OK.
- Click OK on the IIS_IUSRS property window.
- Close the Local Users and Groups management console
- Restart IIS
- Dynamic compression should be working.