

Ask HN: What content types do you gzip and why? - CalcHere

I am currently using gzip * at level 9. Standard advice seems to be, do not compress graphics files and PDFs.<p>I read moot&#x27;s post yesterday about saving a few transmission bytes and I did an experiment. I got some pages from 6 big web sites and saved all the files and http headers. From the Content-Encoding in the headers they do not seem to gzip any graphics files. When I measured the file sizes with and without compression I found gzip on level 9 gave a total 1.36% saving on JPG, 1.1% on PNG and 6.95% on GIF. Particularly the larger GIFs were worth compressing. I tried excluding the files which increased in size when &#x27;compressed&#x27;, this could be done automatically on the server, and it made almost no difference to the totals.<p>I tried gzip on a couple of random PDF files and they gave big savings.
======
nkuttler
Had you used tools like qpdf, optipng, pngcrush, gifsicle or jpegtran on those
files before compressing them?

~~~
CalcHere
No I just used gzip on maximum against the graphics files I was given by the
pages on the major web sites. I did not try to optimize them before the gzip.
The two PDF files were just random ones on my computer, not sure where they
came from.

