CloudFront vs Cloudflare CDN cost: compare the right line items (bandwidth, requests, origin egress)
The easiest way to compare CloudFront vs Cloudflare cost is to treat the CDN bill as a set of line items, not a single number. If you model the same line items for both providers, you can swap pricing assumptions and see which driver actually dominates for your traffic.
0) Start with the same 3 core line items
- Bandwidth: GB delivered from edge to end users ($/GB).
- Requests: request fees (often per 10k or per 1M) if applicable.
- Origin egress (cache fill): bytes pulled from origin to CDN on cache misses, billed by your origin provider.
Bandwidth is not the same as origin egress. If you double-count those legs, your comparison will be wrong.
1) Measure traffic inputs (baseline + peak)
Use a representative window (a normal week and an incident week if you have one). CDNs are often dominated by peak events: bot traffic, marketing spikes, deploys that reduce cache hit rate, and incidents.
Tools: CDN bandwidth, CDN request fees, RPS to monthly requests.
2) Model origin egress from hit rate (the cache fill leg)
A practical estimate is: origin GB ~= edge GB * (1 - hit rate). Purges, low TTLs, and deploys can temporarily crush hit rate and spike origin traffic.
Tools: CDN origin egress, Data egress cost.
3) Add-ons that commonly flip the winner
- WAF / bot mitigation: security add-ons can dominate for attack-heavy traffic.
- Logs: access logs at high request volume can be expensive (ingestion + retention + scans).
- Edge compute: functions/worker usage can become its own cost center.
- Image optimization: can reduce bandwidth but add compute/caching costs depending on plan.
If you enable add-ons, model them as explicit line items instead of hiding them inside $/GB.
4) Comparison checklist (what to verify)
- Region mix: split GB and requests by region if you can; pricing often differs by geography.
- Request units: per 10k vs per 1M (order-of-magnitude mistakes are common). Guide: CDN request pricing.
- Hit rate: validate hit rate by path; one large endpoint can dominate origin egress even if overall hit rate looks good.
- Peaks: model bot spikes and incident windows separately.
- Commitments: discounts change the effective rate; ensure you model realistic utilization.
Worked template (copy/paste)
- Edge GB/month = baseline + peak
- Edge requests/month = baseline + peak (include bots/retries)
- Origin GB/month ~= edge GB/month * (1 - hit rate) (model purge/deploy separately)
- Add-ons = WAF + logs + edge compute (explicit line items)