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?

F.H.
  • 1,456
  • 1
  • 20
  • 34
  • 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? – Pipe Jun 08 '22 at 15:25

1 Answers1

1

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

F.H.
  • 1,456
  • 1
  • 20
  • 34
  • 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). – Octave Jun 19 '22 at 12:00
  • 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. – F.H. Jun 20 '22 at 14:35
  • 1
    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. – Octave Jun 23 '22 at 22:48