0

On Pingdom Tools I get a message to Compress components with gzip. We use asp.net on Windows 2016 server (IIS10). I have set in web.config the following

<httpCompression>
      <staticTypes>
        <add mimeType="text/*" enabled="true" />
        <add mimeType="message/*" enabled="true" />
        <add mimeType="application/javascript" enabled="true" />
        <add mimeType="application/x-javascript" enabled="true" />
        <add mimeType="image/jpeg" enabled="true" />
        <add mimeType="image/png" enabled="true" />
        <add mimeType="image/svg" enabled="true" />
        <add mimeType="*/*" enabled="false" />
      </staticTypes>
      <dynamicTypes>
        <add mimeType="text/*" enabled="true" />
        <add mimeType="message/*" enabled="true" />
        <add mimeType="application/javascript" enabled="true" />
        <add mimeType="application/x-javascript" enabled="true" />
        <add mimeType="image/jpeg" enabled="true" />
        <add mimeType="*/*" enabled="false" />
      </dynamicTypes>
      <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" 
      dynamicCompressionLevel="8" />
    </httpCompression>
    <urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="false" />

I have read that compressing jpg files might not be an advantage as it can actually make the file larger. I have gone through all files on the server and only jpg and png files do not have gzip or br set on content-encoding.

That leaves me with a few questions:

  1. Why do the jpg files not show as content-encoding: gzip
  2. Should I care about it?
  3. If I should care, how can I fix the problem?
6
  • 1
    Compressing JPEG content makes no sense and hence shouldn't be done, because JPEG already optimize things in such a way that no useful compression can happen later on it. On the contrary, compressing PNG content can be useful. Jul 17 at 3:48
  • 1
    Thanks for the response. PNG compression is already enabled, but still get these errors and thereby lower rating. Anyway, even though I have set add mimeType="image/png" enabled="true" it does not seem to compress them. Any suggestions on how to solve this? Jul 17 at 3:55
  • "it does not seem to compress them." How do you test? Using a browser and development tools? Using a CLI HTTP client like wget or curl? Jul 17 at 3:59
  • I see this by using Chrome F12 and see header information for each file. Jul 17 at 5:27
  • I dont "do" Windows, but I wonder if it is referring to gzipping scg's, CSS, html and Javascript etc by way of a directive at the seever level?
    – davidgo
    Jul 17 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.