Learn
Is a CDN worth it? When CloudFront costs more than your servers
A CDN is the standard answer to "how do we handle more traffic?" It often is the right answer, for large files and users far from your servers. But CloudFront bills every request, and at high request rates for small responses, that bill can dwarf the servers it was meant to protect.
· 2 min read
CDN or servers?
- CloudFront, pay-as-you-go
- $54,794/month
- Servers (30 × c7g.large), load balancer and data transfer
- $4,437/month
At 20,000 req/s of 0.5 KB responses, the CDN costs about 12.4× as much as serving every request from your own servers.
Approximate AWS on-demand prices for us-east-1, read once in October 2026, before free tiers. They may be out of date; check the AWS pricing pages before you budget.
How CloudFront bills
On pay-as-you-go pricing in the United States, CloudFront charges for two things:
- Requests: $0.01 per 10,000 HTTPS requests, which is $1 per million.
- Data out: $0.085 per GB for the first 10 TB a month, falling at higher volumes.
The pay-as-you-go free tier covers the first 10 million requests and 1 TB a month. AWS also now sellsflat-rate plans with monthly allowances; check them against your volumes. Serving the same bytes straight from EC2 isn't free either: data transfer out to the internet costs about $0.09 per GB.
Two cases, two answers
| Tiny responses, high rate | Large files, modest rate | |
|---|---|---|
| Traffic | 20,000 req/s × 0.5 KB | 1,000 req/s × 500 KB |
| CloudFront | $54,794/month | $114,318/month |
| Your servers, load balancer and data transfer | $4,437/month | $128,908/month |
| Cheaper | Servers, by 12× | CloudFront |
For tiny responses, the per-request charge dominates and there's almost no bandwidth to save, so the CDN costs many times the servers. For large files, bandwidth dominates, CloudFront's per-GB price is slightly below EC2's, and your load balancer and servers stop carrying the bytes. Prices assume traffic runs at that rate all month.
What a CDN is really for
- Large static files: images, video, downloads, JavaScript bundles.
- Distance: a packet from California to the Netherlands and back takes about 150 ms. A nearby edge cuts that for every user far from your region.
- Bursts: a CDN absorbs a sudden spike on popular content before it reaches you.
- Protection: a large edge network soaks up abusive traffic your origin couldn't.
For small dynamic responses at a high, steady rate, cache in memory instead (Redis), and use HTTP caching so browsers keep responses that don't change.
A real example: redirects
A URL shortener at 20,000 redirects a second is the textbook case. Every redirect is a few hundred bytes, so putting CloudFront in front costs over $50,000 a month at list price, against a few thousand dollars for load-balanced servers, a cache and a database. That's why the reference design in the URL shortener challenge has no CDN, and why adding one blows its budget.
Frequently asked questions
How much does CloudFront cost per million requests?
On pay-as-you-go pricing in the United States, $0.01 per 10,000 HTTPS requests, which is $1 per million, plus data transfer from $0.085 per GB for the first 10 TB a month. The pay-as-you-go free tier covers the first 10 million requests and 1 TB a month.
When is a CDN worth it?
When responses are large (images, video, downloads), when users are far from your servers, or when you need to absorb sudden bursts. It's rarely worth it for tiny dynamic responses at very high request rates, where the per-request charge dominates.
Do CloudFront's flat-rate plans change the maths?
They can. AWS now also offers flat-rate CloudFront plans with monthly allowances. Compare your expected request and data volumes against a plan before assuming pay-as-you-go prices.