3 ms·
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.
by fouc 8y ago
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.
- samschooler 8y agoIts 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.
- tracker1 8y agoMany 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.
- technion 8y agoConsider the instructions for the nginx fork: https://github.com/eustas/ngx_brotli 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.