6

Is it still relevant to enable gzip compression after compressed the WebP images..?

In my case I use compression middleware for express.

Altiano Gerung
  • 824
  • 2
  • 15
  • 28

2 Answers2

6

Yahoo suggests against it:

Image and PDF files should not be gzipped because they are already compressed. Trying to gzip them not only wastes CPU but can potentially increase file sizes.

https://developer.yahoo.com/performance/rules.html

And this may be helpful: https://webmasters.stackexchange.com/questions/8382/gzipped-images-is-it-worth

haboutnnah
  • 1,118
  • 11
  • 19
  • Thanks for the answer. Can you update your answer or maybe @robertklep Because the answer is kinda yes and no. No because compressed images doesn't need to be gzipped. And Yes because I don't need to do anything else practically right now, because it is already (not) handled by the `compression` middleware. – Altiano Gerung Oct 11 '17 at 01:59
3

Is it still relevant to enable gzip compression after compressed the WebP images..?

Yes.

The compression middleware never compressed images to begin with (by default), because most image formats already implement compression.

It only compresses responses for the following mime types:

  • text/*
  • */*+json
  • */*+text
  • */*+xml

(and possibly other formats if their "compressibility" is known, see the compressible documentation for more details)

Converting images to WebP doesn't make a difference on how it works, and the abovementioned mime types are still good candidates to apply compression to.

robertklep
  • 198,204
  • 35
  • 394
  • 381
  • Great answer! I guess my question kinda ambiguous.. It is yes and no. No because compressed images doesn't need to be gzipped. And Yes because I don't need to do anything else practically right now, because it is already (not) handled by the middleware. – Altiano Gerung Oct 11 '17 at 01:56
  • @AltianoGerung that's right. The default configuration for `compression` is smart enough to know which types of files/responses to (not) compress. – robertklep Oct 11 '17 at 06:05