How to check browser's support for brotli compression on client application side?

783 Views Asked by At

I am asking this question for educational purposes. I have hosted my static assets on S3 with Cloud front. I want to apply brotli and gzip compression during the build process.

As per articles available on various platforms It is possible to add content-type and intercept S3 origin requests using Lambda@edge. But Lambda@edge is available with region US-east so it is not available to our region.

So is it possible to check the browser's compatible compression on the client-side when we are adding scripts for static assets?

Only solution I could find online is: Can JavaScript detect if the user's browser supports gzip?

1

There are 1 best solutions below

0
Christian Haller On

Edge Lambdas are always in us-east-1. For example: If your bucket is in paris, your cloudfront will always be global and your Lambda@edge too. In the Console it's located in us-east-1.