AWS Amplify deploy - use compression
Asked Answered
E

1

6

We're using AWS Amplify to serve an Angular frontend via CI/CD (connected Github-Repo). Amplify does not seem to compress by default resulting in larger content delivery than necessary.

I can't find any option in the app settings inside the Amplify dashboard nor a solution online.

enter image description here

Is it possible to use compression (gzip or brotli) with AWS Amplify?

Eldon answered 2/2, 2021 at 23:1 Comment(1)
Did you find a solution? We have many sites running on Amplify, some of them are serving gzip files but some of them no. How do you solve it?Grout
E
2

We managed to serve gziped responses and if i remember it correctly it was a setting hidden in the cloudfront configuration.

enter image description here

Altough i don't remember how i've activated that option, probably through the aws-cli.


UPDATE: Amplify seems to serve gzip by default now

Eldon answered 9/6, 2022 at 16:6 Comment(3)
I have the same settings. In my account, it is named "Amplify (Policy for Amplify Origin)" and it was there by default, prior to any deployment. I also verified that the browser is indeed receiving gzip content, which is the case (something like 280KB instead of 1.4MB in my case).Keffiyeh
That makes me think that they changed the default behaviour and serve gzip'ed content without any additional settings (altough i can't find any resources online). Would be nice if any AWS employee could clarify this.Eldon
I'm not an AWS employe, but I can tell that I just deploy an Amplify app with CDK on a fresh new account, and GZIP was enabled by default.Keffiyeh

© 2022 - 2024 — McMap. All rights reserved.