Post

I'm a huge fan of CloudFront - especially since the release of CloudFront Functions that are way cheaper and faster than Lambda@Edge. In my opinion, it's the most flexible CDN solution, as you can easily tamper with the request at every step by running simple JavaScript on the edge.

After migrating away from Edgio, which comes with an XML-based rules engine that was powerful, yes, but not really easy to work with. With CloudFront, we now have a lot of benefits that we've really missed before:

• We can now deploy using Infrastructure as Code and have everything managed as code - including all of our conditions and rewrites. • We can finally support multiple origins (any HTTP or native AWS). • We have full control at every step of the request.

• Instead of hard-to-read XML, we have simple, readable JavaScript rules. • We can test our functions in advance. • Deployment time decreased from 20-40 minutes to 2-5 minutes without version flickering.

Great read! I just moved one of my projects _away_ from CloudFront/S3 because it became too expensive 😀 Combined with CloudFront functions and Lambda@Edge it's a great and very flexible service, but once you have more than 1TB traffic/month, it gets pretty expensive pretty fast...

Yes, Cloudflare R2 with some URL rewrite rules. I guess it's less complex than what you had to migrate though. Free egress is really nice... 😀

Is the flexibility comparable with what you get at CloudFront? Is the rewrite/redirect stuff also just some small JS that you run on the edge? Sounds like a good solution if I could run some JS at the same "places" like with CloudFront 😊