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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南