Reputation: 927
I am always getting RED mark "enable compression for fontawesome-webfont.svg" on https://developers.google.com/speed/pagespeed/insights/
Compressing resources with gzip or deflate can reduce the number of bytes sent over the network. Enable compression for the following resources to reduce their transfer size by 175KiB (70% reduction). Compressing /fonts/fontawesome-webfont.svg?v=4.0.3 could save 175KiB (70% reduction).
I already did IIS provided compression options: Static files only Dynamic application responses only Both static files and dynamic application responses
Upvotes: 3
Views: 1061
Reputation: 2895
By default, IIS doesn't map the MIME type for SVGs. You will have to update your Web.config to include the correct mappings for SVGs like so:
<system.webServer>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<add mimeType="*/*" enabled="false" />
<!-- HERE -->
<add mimeType="image/svg+xml" enabled="true" />
<add mimeType="application/font-woff" enabled="true" />
<add mimeType="application/x-font-ttf" enabled="true" />
<add mimeType="application/octet-stream" enabled="true" />
<!-- HERE -->
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer>
For more details on this, check out this answer. To test whether compression is working or not, use the Chrome Developer Tools and check the HTTP response header contains the following:
Content-Encoding: gzip
Upvotes: 1