3 ms·
One scenario where using gzip might not be a good idea is when serving content less than 2-4 kB, like some thumbnails.
by prakash 18y ago
One scenario where using gzip might not be a good idea is when serving content less than 2-4 kB, like some thumbnails.
- chaosmachine 18y agoGzipping images is generally not a good idea. PNG/GIF/JPEG are already highly compressed and will probably grow in size if you attempt to gzip them.
- _pius 18y agoPNG is often not well compressed unless you've gone out of your way to do so with PNGCRUSH (http://pmt.sourceforge.net/pngcrush/ http://pmt.sourceforge.net/pngcrush/) or something similar
- wysiwtf 18y agoI think this might be better? http://optipng.sourceforge.net/ http://optipng.sourceforge.net/
- lucumo 18y agoYeah, it's pretty good. pngout is good too. But I found some really good compression with pngnq. It's lossy, but can help you with some larger optimisations. I had an image that pngout got to 218K (221K for optipng). pngnq chopped that thing to 74K. When flipping between the images you could see some pixels change, but only if you looked really hard. (Running pngout on that image brought it down to 71K. Nice.)
- eru 18y agoWhen you serve thumbnails in an already compressed format like PNG, JPEG, GIF, then it should not make any sense to gzip them anyway.
- prakash 18y agotrue about the image part. images shouldn't be gzipped, bad examples. It still stands for files less than 2-4 kB.
- mkinsella 18y agoCan Apache/nginx be configured to not gzip images or files smaller than a certain size?