Brotli compression doesn't work

0

Hi,

I enabled Brotli compression on our Cloudfront distribution (E1L4UNJ3XCTUFM).
The browser sends this request header: Accept-Encoding: gzip, deflate, br
And cloudfront responds with: content-encoding, gzip

According to the documentation: “When the viewer supports both formats, CloudFront uses Brotli.”

So the distribution is compressing properly, but why doesn't it choose the Brotli compression?

質問済み 3年前915ビュー
2回答
0

Hi,

Thank you for raising your concern.

Yes the documentation is correct that when the viewer supports both formats, CloudFront uses Brotli. But as you said Cloudfront always responds with content-encoding: gzip even for Accept-Encoding: gzip, deflate, br, I would like you to confirm that origin is not returning the gzip compressed file to CloudFront.

If your origin returns a compressed file to CloudFront, CloudFront detects that the file is compressed based on the value of the Content-Encoding header and doesn’t compress the file again. (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html)

AWS
回答済み 3年前
0

Hi,

Many thanks, this pointed me in the right direction. Apparently, for some files the build process already zipped them when uploading to s3.

Best,
Marcel

回答済み 3年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ