将 Brotli 与 Firebase 托管结合使用

Using Brotli with Firebase hosting

有没有办法在 Firebase 托管中使用 Brotli 压缩而不是 gzip?我知道 Firebase 会自动压缩它,但到目前为止它只使用 gzip。

我以某种方式结束了这个问题,尽管它已经过时了我想提一下现在应该可以使用 Firebase Cloud Functions 使用 Brotli 压缩。我还没有测试过它,但由于您可以通过 Cloud Functions 运行 您自己的 node.js 代码,所以我看不出有任何原因这不起作用。当然,使用 Cloud Functions 可能会降低您的应用程序的速度,因此请务必仔细测试这种方法。它可能不会提供您希望的加载提升。

Firebase 托管现在默认启用 Brotli 压缩:https://firebase.googleblog.com/2020/08/firebase-hosting-new-features.html