Enable fontawesome-webfont.svg compression

I always get the RED tag "enable compression for fontawesome-webfont.svg" at 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 can save 175KiB (70% reduction).

I have already provided IIS with compression options: Static files only Dynamic application responses only Both static files and dynamic application responses

+3


source to share


1 answer


By default, IIS does not display the MIME type for SVG. You will need to update your Web.config to include correct mappings for SVG, e.g .:

<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>

      



See this for more details. To check if the compression is working, use the Chrome Developer Tools and check that the HTTP response header contains the following:

Content-Encoding: gzip

      

+1


source







All Articles