Zopfli is a free, open-source program from Google written in C that aims to increase the compression ratio of files, which when implemented correctly can significantly improve web server and network performance.
Visit the Zopfli GitHub page at https://github.com/google/zopfli
Zopfli Compression Algorithm is a new zlib (gzip, deflate) compatible compressor. This compressor takes more time (~100x slower), but compresses around 5% better than zlib and better than any other zlib-compatible compressor we have found.
Zopfli is not intended to replace traditional compression programs. As mentioned above, it is much, much slower to process, and intentionally trades compute time for a smaller file.
How can I use Zopfli to speed up my web server?
The suggested use here is that you can pre-compress web files ahead of time so your server (Apache, Nginx, etc.) does not have to do compression on demand. Your web server will be configured to look for a pre-compressed version of your web file, and serve that instead.
Another benefit to pre-compress web files is that your web server will know the length of the compressed file, and will be able to include the byte length of the file inside the HTTP header.
How to Install
Instructions on how to install Zopfli on Linux
cd ~ git clone https://github.com/google/zopfli.git cd zopfli make chmod +x zopfli cp zopfli /usr/local/bin/
Integrate Zopfli with WinSCP
Here's a trick for WinSCP users. Here is how you can add a 'Right-click' menu option to precompress a file as Zopfli .gz
- Go to View | Preferences
- Near the bottom select Commands
- Click the Add... button and in the Description field type
Precompress as gzip with Zopfli
- In the Custom command field type
zopfli "!" && touch -am -c -r "!" "!".gz