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?