News for hackers. Stuff that matters.
Re:Commento: Open-Source Disqus Alternative by technion on Wednesday March 20, 2019 @04:34AM (#19440098)
The brotli experience has been frustrating.

All modern browsers support it, so you'd think it would be an easy win. The top nginx search is an official looking Google project which is long abandoned and doesn't support current versions of the library. There's an official nginx module which is commercial, and then finally there's a supported fork that that sits on about page three of Google.

Shared hosts don't generally support it. AWS Cloudfront doesn't support it, along with several other CDNs. Big + to Cloudflare for proper support.

It reduced my bundle sizes measurably. We all hate bloat and want to reduce bundles, but there seems to be a community inertia around mass deployment.

Re:Commento: Open-Source Disqus Alternative by adtac on Wednesday March 20, 2019 @05:10AM (#19440288)
Ah, that sucks. The hosted version uses Cloudfront as CDN for static assets, too bad they don't support it.

>official looking Google project which is long abandoned

Is [1] what you're talking about?

[1] https://godoc.org/github.com/google/brotli/go/cbrotli

Re:Commento: Open-Source Disqus Alternative by technion on Wednesday March 20, 2019 @06:45AM (#19440767)
The [1] I should have linked is here: https://github.com/google/ngx_brotli/issues/72
Re:Commento: Open-Source Disqus Alternative by wyday on Wednesday March 20, 2019 @08:49AM (#19441491)
Re:Commento: Open-Source Disqus Alternative by cdbattags on Wednesday March 20, 2019 @10:25AM (#19442516)
Ever looked into OpenResty?

Take a peek at https://github.com/sjnam/lua-resty-brotli.

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.
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.