Comment by MrDOS

4 years ago

Of surprise to no one, Brotli does better on both:

    $ ls -l *.js
    -rw-r--r--  1 mrd  staff  330904  5 May 01:04 watch.js
    -rw-r--r--  1 mrd  staff  152172  5 May 01:10 watch.min.js
    $ brotli watch.js
    $ brotli watch.min.js
    $ ls -l *.br
    -rw-r--r--  1 mrd  staff  34461  5 May 01:04 watch.js.br
    -rw-r--r--  1 mrd  staff  27122  5 May 01:10 watch.min.js.br

If I were serving this content, and if my web server and all of my target browsers supported Brotli, I'd be somewhat more content to ship an un-minified + Brotli-compressed file than an un-minified + gzip'd one. I'm sure it's some rule of thumb stuck in my head from the Web 2.0 era, but a JavaScript payload in excess of 40KB crosses some warning line in my head. (Probably 40KB / ~4KB/s throughput on a good dial-up connection = 10s transfer time, about the longest you'd want to wait for even a pretty spiffy page to load.)

> I'd be somewhat more content to ship an un-minified + Brotli-compressed file than an un-minified + gzip'd one.

Whoops, typo: I meant to say that I'd be somewhat more content to ship an un-minified + Brotli-compressed file than a minified + gzip'd one. That is, I'd be more happy to serve the 34.4KB watch.js.br than the 32.5KB watch.min.js.gz.