I now and always use gzip with nginx but never use it for images. Try to find some adventages/disadventages of that kind solution but nothing found.
Of course I can use client side caching in nginx and set expired days for images - but then first load will be always full load without any optimization.
Soo should I or shouldnt gzip images jpeg png etc. ? What this type of commpresion do - change commpression of images to lower quality?
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.
The command requests a file from our Nginx server and specifies that it is fine to serve gzip compressed content by using an HTTP header ( Accept-Encoding: gzip ): In the last line, you can see the Content-Encoding: gzip header. This tells us that gzip compression was used to send this file.
So the standard way to configure your server for Gzip or Brotli is by providing a list of MIME types you want to compress. How to add a MIME type to the compression list?
The JPG or JPEG (Joint Photographics Experts Group) is one of the most used image formats due to its ability to be opened up and converted by almost any standard program - all while file size remains relatively small.
You don't compress images because images are already compressed. In some cases it can actually make them larger (but I've forgotten the reason why). These are binary formats, similar to videos and you won't gain any benefit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With