文件地址:Windows\System32\inetsrv\config\applicationHost.config
在其中的<dynamicTypes>(即动态压缩类型)节中增加以下两个配置即可:
<add mimeType="application/json" enabled="true" />
<add mimeType="application/json; charset=utf-8" enabled="true" />
配置完毕后
<system.webServer> <urlCompression doDynamicCompression="true" /> <httpCompression> <dynamicTypes> <add mimeType="application/json" enabled="true" /> <add mimeType="application/json; charset=utf-8" enabled="true" /> </dynamicTypes> </httpCompression> </system.webServer>