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?

asked 3 years ago895 views
2 Answers
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
answered 3 years ago
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

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions