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?

gefragt vor 3 Jahren917 Aufrufe
2 Antworten
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
beantwortet vor 3 Jahren
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

beantwortet vor 3 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen