Prefer zlib over zopfli for gzip?
See original GitHub issueThere was some nice work done in #36 to make iltorb
and node-zopfli-es
optional.
But zopfli-compat.js is preferring zopfli
over zlib
, and printing a warning if node-zopfli-es
is not installed. zopfli
may create gzip assets 5% smaller than zlib
, but it is much slower (~100x).
Since shrink-ray-current
is for use at runtime, speed is very important and I would prefer to use zlib
not zopfli
. This would be consistent with brotli-compat.js which is preferring zlib
over iltorb
. Would you be open to this change, or alternatively silencing the warning Module "node-zopfli-es" was unavailable
?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to implement zopfli for a better gzip compression?
You can use zopfli in advance, to pre-compress your assets before deploying them on the server. One way you can now do this...
Read more >Improved Compression Ratios Using Zopfli - Dean Hume's Blog
Most modern browsers work effectively with compressed files and use lossless compression formats such as Gzip, Deflate or Zlib.
Read more >Zopfli - Wikipedia
Zopfli is a data compression library that performs Deflate, gzip and zlib data encoding. It achieves higher compression ratios than mainstream Deflate and ......
Read more >Comparison of Brotli, Deflate, Zopfli, LZMA, LZHAM and Bzip2 ...
We compared the performance of brotli by measuring the compression ratio and speed, as well as decompression speed on three different corpora: the...
Read more >Compress data more densely with Zopfli - Hacker News
(Though as mentioned as a pro of zopfli, xz would lose on decompression ... a .gz file which is compatible with standard tools...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi Alorel, that’s OK. If we add an option the change might look something like this:
useZopfliForGzip
which defaults totrue
const zopfli = zopfliCompat();
inside thecompression
function so we can passopts.useZopfliForGzip
tozopfliCompat
.zopfli-comat.js
,return require('zlib')
ifuseZopfliForGzip
is false.Would you like a PR for this?
Thanks for the contribution, published as 4.1.0