Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I enable GZIP compression for WebP images?

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

In my case I use compression middleware for express.

like image 847
Altiano Gerung Avatar asked Oct 10 '17 08:10

Altiano Gerung


People also ask

Should I use gzip compression?

Why Do We Use GZIP Compression? GZIP is effective, but it's not the only compression method out there. In fact, it's not even the best method in terms of size reduction. GZIP can reduce the amount of data by up to 70%.

Should I gzip images?

Don't use gzip for image or other binary files Image file formats supported by the web, as well as videos, PDFs and other binary formats, are already compressed; using gzip on them won't provide any additional benefit, and can actually make them larger. To compress images, see Optimize images.

Can WebP be compressed?

WebP images can be compressed via either the lossless or lossy methods. The techniques used to achieve compression results for each method are different, which is explained in greater detail below.

Does gzip improve performance?

Gzip is a fast and easy way to improve page speed performance while still delivering a high-quality experience to your users. See if your website supports gzip by running a free speed test, and sign up for a free trial for more insights into your website's performance.


2 Answers

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

like image 196
haboutnnah Avatar answered Oct 01 '22 00:10

haboutnnah


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.

like image 27
robertklep Avatar answered Sep 30 '22 23:09

robertklep