You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a front-end proxy, such as nginx, it is not possible to use a different Content-Encoding such as Brotli, because the files are already gzip encoded.
I would like to discuss the possibility to introduce a new environment variable, that allows disabling the Auto-compress feature: METEOR_DISABLE_AUTO_COMPRESS=1
1) Running Meteor with --production flag:
gzip is used for Content-Encoding.
2) Running Meteor with --production flag behind nginx proxy with Brotli enabled:
Mixed Content-Encoding with gzip and br. The gzip encoded files cannot be encoded to Brotli.
3) Running patched Meteor with --production flag behind nginx proxy with Brotli enabled:
Only Brotli is used for Content-Encoding. nginx takes care of encoding the uncompressed files to Brotli.
Related work on Brotli support
Currently Node.js is working actively on adding Brotli compression to core: nodejs/node#20458 nodejs/node#18964
Reasoning for environment variable
Adding an environment variable to disable Auto-compress will allow to use Brotli compression through a front-end proxy and provide better compression ratio than gzip.
Hello @benjamn,
the Auto-compress feature of Meteor currently uses gzip compression and is enabled by default.
https://github.com/meteor/meteor/blob/release-1.8.1/packages/webapp/webapp_server.js#L822
When using a front-end proxy, such as nginx, it is not possible to use a different Content-Encoding such as Brotli, because the files are already gzip encoded.
I would like to discuss the possibility to introduce a new environment variable, that allows disabling the Auto-compress feature:
METEOR_DISABLE_AUTO_COMPRESS=1
The implementation is in PR: #10378
1) Running Meteor with --production flag:
gzip is used for Content-Encoding.
2) Running Meteor with --production flag behind nginx proxy with Brotli enabled:
Mixed Content-Encoding with gzip and br. The gzip encoded files cannot be encoded to Brotli.
3) Running patched Meteor with --production flag behind nginx proxy with Brotli enabled:
Only Brotli is used for Content-Encoding. nginx takes care of encoding the uncompressed files to Brotli.
Related work on Brotli support
Currently Node.js is working actively on adding Brotli compression to core:
nodejs/node#20458
nodejs/node#18964
There were some discussions in https://github.com/expressjs/compression to support Brotli compression, that were not further pursued.
Brotli browser support: https://caniuse.com/#feat=brotli
Reasoning for environment variable
Adding an environment variable to disable Auto-compress will allow to use Brotli compression through a front-end proxy and provide better compression ratio than gzip.
Some tests with my PR (#10378)
Note:
Test environment:
Ubuntu 18.04
nginx-1.15.7
brotli: 1.0.3-1ubuntu1.2
ngx_brotli: https://github.com/eustas/ngx_brotli
Thanks, Georgy
The text was updated successfully, but these errors were encountered: