I use CloudFront when the client is all-AWS. For anything public and popular, Cloudflare wins on price.
Use it when
- An AWS-only client, or origins that must stay private inside AWS.
Don't use it when
- Big, high-traffic public sites on pay-as-you-go pricing: use Cloudflare.
Pricing
Pay-as-you-go egress is expensive at volume. The flat-rate plans (for example Business: $200 a month for 50 TB) change the argument.
In my words: what hurts
- Egress cost too high for big, high-traffic sites.
Gotchas, with fixes
Gotcha: Pay-as-you-go egress can turn a viral page into a big bill.
Fix: Check the flat-rate plans, or put Cloudflare in front.
Provisioning
Official Pulumi package · Official Terraform provider
Instead, consider
- Cloudflare static hosting Websites and public assets.
Where it fits
- A website, SPA or PWA: Don't.
Not for a public site you can host anywhere. You'd assemble S3, origin access, a certificate and cache invalidations to get what Cloudflare gives you from a GitHub push, and pay-as-you-go egress can turn a viral page into a real bill where Cloudflare charges nothing. CloudFront stays right for all-AWS clients and private AWS origins.
Instead: Cloudflare static hosting
Sources
Last reviewed by Nicolas Dao