Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable Brotli Compression on cloudfront

I have an angular 4 production build deployed on cloudfront. For compression i have enabled gzip compression on the server. I want to enable brotli compression on cloudfront for each requested resource.

I am already sending the gzip br headers as shown in image below:

enter image description here

How to configure brotli compression on cloudfront?

like image 293
Deepak Kumar Avatar asked Oct 29 '22 06:10

Deepak Kumar


2 Answers

CloudFront now supports Brotli compression. CloudFront includes 'br' in the normalized 'Accept-Encoding' header before forwarding it to your origin. If your origin does not handle compression, CloudFront can compress cacheable responses at the edge using Brotli.

See the announcement or docs for specific details.

like image 109
Cristian Avatar answered Nov 15 '22 05:11

Cristian


You will have to handle this on your origin server, CloudFront is gzip only.

If your origin sends a Content-Encoding header CloudFront should not gzip it.

See the docs.

like image 28
at0mzk Avatar answered Nov 15 '22 07:11

at0mzk