Asp.net 将GZIP应用于SVG-WebConfig

Asp.net 将GZIP应用于SVG-WebConfig,asp.net,svg,web-config,iis-7.5,gzip,Asp.net,Svg,Web Config,Iis 7.5,Gzip,我的网站中同时启用了静态和动态内容压缩 <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" dynamicCompressionDisableCpuUsage="90" dynamicCompressionEnableCpuUsage="70"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzi

我的网站中同时启用了静态和动态内容压缩

<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" dynamicCompressionDisableCpuUsage="90" dynamicCompressionEnableCpuUsage="70">
  <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
  <dynamicTypes>
    <add mimeType="*/*" enabled="true"/>
  </dynamicTypes>
  <staticTypes>
    <add mimeType="*/*" enabled="true"/>
  </staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>
我检查了.aspx、.js和.css文件的内容编码-它是gzip-到目前为止还不错。但是,压缩不适用于SVG。PageSpeed也会通知我这个YSlow没有

我使用SVG作为图像src属性和CSS类。CSS类是否被视为动态内容

IIS静态压缩设置为仅压缩大于500字节的文件-所有这些SVG都高于此限制

安装了静态和动态压缩模块


我缺少什么?

您的.svg文件是否提供了正确的内容类型image/svg+xml


当响应中没有正确的内容类型时,压缩模块将不会压缩响应。

嘿,内容类型似乎正常接受:image/webp,/;q=0.8接受编码:gzip,deflate,sdch接受语言:en-US,en;q=0.8 HTTP/1.1 200 OK缓存控制:最大年龄=31536000内容类型:图像/svg+xml我甚至添加到WebConfig