安装iis时,勾选动态内容压缩

image.png

开启压缩

image.png
image.png

设置压缩类型

编辑C:\Windows\System32\inetsrv\config\applicationhost.config文件,增加如下内容

  1. <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
  2. <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
  3. <dynamicTypes>
  4. <add mimeType="application/json" enabled="true" />
  5. </dynamicTypes>
  6. </httpCompression>

重启IIS服务