Google developers have released a new compression library called Zopfli. This library, written in C, is compatible with zlib, yet provide a better compression, more exactly 3 to 8% according to Google. This library can be used on servers for better compression in order to save bandwidth, as well as delivering web pages faster. Since it’s fully compatible with zlib, the web browsers do not need to be changed. The only drawback is that it’s several magnitude slower than zlib, so it’s better used for static content that is compressed once, and sent over the Internet many times, and it may not be a good choice for dynamic content. The source code is available at https://code.google.com/p/zopfli/, so let’s try it. Get the code and build zopfli:
1 2 3 |
git clone https://code.google.com/p/zopfli/ cd zopfli make |
Different levels of compression are available:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
./zopfli -h Usage: zopfli [OPTION]... FILE -h gives this help -c write the result on standard output, instead of disk filename + '.gz' -v verbose mode --gzip output to gzip format (default) --deflate output to deflate format instead of gzip --zlib output to zlib format instead of gzip --i5 less compression, but faster --i10 less compression, but faster --i15 default compression, 15 iterations --i25 more compression, but slower --i50 more compression, but slower --i100 more compression, but slower --i250 more compression, but slower --i500 more compression, but slower --i1000 more compression, but slower |
For testing purpose, I’ve just saved this blog as one html file (test.html – 67275 bytes) […]