Re:Commento: Open-Source Disqus Alternative
by fouc on Wednesday March 20, 2019 @10:12AM
(#19442346)
Anyone know why brotli needs to be generated at the web server level? Just curious why/if it can't be done at the web app level.
[ Parent
| on HN ]
Re:Commento: Open-Source Disqus Alternative
by technion on Wednesday March 20, 2019 @04:53PM
(#19446775)
Consider the instructions for the nginx fork:
https://github.com/eustas/ngx_brotli
The "filter" module operates totally within nginx, and behaves roughly how we're used to with gzip. The "static" module allows you compress files as part of your build and just serve them - but the server still needs to understand the relevant headers and how to deal with them.
Re:Commento: Open-Source Disqus Alternative
by samschooler on Wednesday March 20, 2019 @12:30PM
(#19443816)
Its generally used as a data transfer compression system. So the web server needs to compress the data before its sent to the browser. If you did it at the web app level (client/browser side), the data would already be transferred so there are no size savings.
Re:Commento: Open-Source Disqus Alternative
by tracker1 on Wednesday March 20, 2019 @12:54PM
(#19444094)
Many web servers will serve file.ext.(gz|br) as a pre-compressed option. In order for brotli to beat gzip on size, you need more CPU time, so it's best if precompressed. This also means it's not really an option for dynamic content.