Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support for Brotli compression #71
Is it an idea to add Brotli compression for https-requests to this module? Now support for Brotli has landed in the developer channels of Firefox and Chrome it is very likely that a significantly amount of clients will have support for this enabled in the very near future. So, it is maybe a good idea to support it in this module too.
I’m not (yet) very experienced with building modules for Node, but if there is anything I can help with, please let me know.
Hi! This was discussed before in #59 if you want to read the prior discussion.
The answer is that we certainly can, but for it to be built-in here, we need the support either added to Node.js core or a pure-JS library.
Barring that, another option is to make this module flexible and allow for alternative user-defined encodings. There was the PR #62 but it was never completed due to a disagreement between the author and myself over a feature I wanted to be supported.
The performance of brotli is something that should be kept in mind.
Some previous tests:
brotli isn't necessarily always more efficient than gzip. brotli's biggest advantage is that at higher compression levels, at the cost of compression time, you can get compression ratios beyond what you can do even by using zopfli.
So you don't really get an advantage from using zopfli or brotli for dynamic content. They work best when you can wait a few extra seconds to let the compressor do more work.
For most people this means making a .gz file (using zopfli) and a .bro file with brotli during your build step and using the pre-compressed files instead of dynamically compressing with either.
referenced this issue
Jul 6, 2016
@dantman At level 4, Brotli uses less CPU AND compresses better than gzip - here's the results of a test using the top 1000 URLs on the internet: https://blogs.akamai.com/2016/02/understanding-brotlis-potential.html