
On this page 12 sections
Imagine 10,000 people press play on your live stream at the same moment. If every one of them connects to a single server in one city, that server needs to push 50 gigabits per second, and viewers far away will wait on every segment. The stream will buffer, stall or crash. A content delivery network (CDN) is how streaming services avoid that.
This guide explains what a video CDN does, how it works with HLS and DASH, what it costs, and how to decide whether you need one and which to pick.
What a CDN is
A CDN is a network of servers, called edge servers or points of presence (PoPs), spread across many cities and countries. Instead of every viewer fetching video from your own server (the origin), viewers fetch it from the nearest edge. The edge keeps copies of popular files in its cache, so the origin only needs to send each file once per edge, not once per viewer.
For video, this has three big benefits:
- Scale. The CDN’s total capacity is measured in terabits per second, far more than any single server.
- Speed. Edges near viewers mean lower latency, faster start times and fewer stalls.
- Origin protection. Your origin sees a small fraction of the traffic, so it stays fast and cheap.
Why streaming and CDNs fit so well
Modern streaming formats were designed with CDNs in mind. HLS and DASH break video into small files (segments) delivered over plain HTTP. To a CDN, a video segment is just another file to cache. For a live stream, everyone watches the same segments at almost the same time, so each edge fetches a segment once and serves it to thousands of nearby viewers.
That is why HTTP streaming replaced older protocols like RTMP for delivery: it rides on infrastructure that already exists at massive scale.
How a request flows
- A viewer’s player requests
https://cdn.example.com/live/720p/seg_1043.m4s. - DNS or anycast routing sends the request to the nearest edge server.
- If the edge has the segment cached (a cache hit), it returns it immediately.
- If not (a cache miss), the edge requests it from a mid-tier or shield server, or from your origin, stores a copy and returns it.
- The next viewer near that edge gets a cache hit.
A high cache hit ratio (often above 95 percent for popular video) means fast playback and low origin load.
Key features for video
Not all CDNs handle video equally well. Features that matter:
- Origin shielding: an extra caching layer between edges and your origin, so a cache miss across 200 edges does not become 200 requests to your server.
- Large-file and high-throughput optimisation: tuned for sustained delivery rather than tiny web assets.
- Live streaming support: short cache times for playlists, fast propagation of new segments, and support for LL-HLS blocking requests or chunked transfer for LL-DASH. See low-latency streaming explained.
- Token authentication / signed URLs: so only authorised viewers can fetch your segments.
- Geo-blocking: restrict delivery to licensed countries.
- CORS and header control: essential for web players on other domains.
- Logs and real-time analytics: see errors, cache ratios and traffic by region.
- HTTP/2 and HTTP/3 (QUIC): improve performance on mobile networks.
- Multi-CDN support: large services use several CDNs and switch between them for resilience and cost.
What a CDN costs
CDN pricing is usually based on data transferred (egress), sometimes with request charges. Typical ranges:
- Large public-cloud CDNs: commonly a few cents per GB at low volume, dropping with volume. Delivery to some regions costs more.
- Video-focused and budget CDNs: often under a cent to around 1 to 2 cents per GB in North America and Europe.
- Committed contracts: large customers negotiate per-GB rates well below list prices, or pay per Mbps of peak traffic.
To estimate, you need your total delivered data. For live events: bitrate × viewers × duration. Our streaming bandwidth calculator works this out, and video streaming bandwidth requirements shows the formulas.
Example: a 2-hour live event at 5 Mbps with 2,000 viewers delivers roughly 9.7 TB with overhead. At $0.01 per GB, that is about $97; at $0.05 per GB, about $486.
Also consider origin egress: if your origin is in a cloud provider, data sent from it to the CDN may also be charged, unless the provider has a partnership or you use origin shielding effectively.
Do you need a CDN?
You probably do not need a separate CDN if:
- You use a hosted platform like YouTube, Vimeo, Wistia, Mux, Cloudflare Stream, Bunny Stream or a course platform. They include CDN delivery.
- Your audience is tiny, for example a few internal viewers on a company network.
You do need one if:
- You self-host HLS or DASH files for more than a handful of concurrent viewers.
- Your audience is spread across countries.
- You run live events with spikes of traffic.
- You need signed URLs, geo-blocking or detailed delivery logs for your own content.
Choosing a CDN for video
Questions to ask:
- Where are your viewers? Check the CDN’s PoP coverage and pricing in those regions.
- Live, VOD or both? For live, ask about playlist caching, LL-HLS support and origin shielding.
- How will you secure content? Token authentication, signed cookies, and DRM compatibility.
- What are the terms? Some CDNs restrict heavy video use on standard plans and require a video-specific product.
- What visibility do you get? Real-time logs and analytics matter when viewers report problems.
- What does it really cost? Include egress, requests, origin egress, storage and any minimum commitments.
Well-known options include Akamai, Amazon CloudFront, Fastly, Google Cloud CDN, Microsoft Azure Front Door, Cloudflare (with Cloudflare Stream for video), Bunny.net, CDN77, Gcore, KeyCDN, Edgio and others. Many video platforms bundle one of these.
Setting up a CDN for HLS
A typical self-managed setup:
- Store your packaged HLS/DASH files in object storage (S3, R2, GCS, Azure Blob, Bunny Storage) or serve them from a packager.
- Create a CDN distribution with that storage as the origin.
- Configure caching:
- VOD segments: long cache times (days or more), since they never change.
- VOD playlists: long cache times too, unless you edit them.
- Live media playlists: very short cache times, around 1 second or half the segment duration.
- Live segments: moderate cache times; they do not change once created.
- Set CORS headers to allow your player’s domain.
- Enable HTTPS and HTTP/2 or HTTP/3.
- Add token authentication if content is not public.
- Test with our HLS player from several locations.
Common CDN mistakes with video
- Caching live playlists too long: players see stale playlists and stall at the live edge.
- Forgetting CORS: web players fail while VLC works. See HLS stream not playing.
- Query strings breaking the cache: if every viewer has a unique token in the query string and the CDN includes it in the cache key, every request becomes a cache miss. Configure the CDN to ignore token parameters in the cache key.
- No origin shield: a popular live event hits the origin from every edge.
- Wrong MIME types: some devices reject playlists served as generic binary.
Multi-CDN: when one is not enough
Large streaming services rarely rely on a single CDN. With a multi-CDN setup, traffic is split between two or more providers, and a steering layer decides which CDN each viewer uses.
Reasons to go multi-CDN:
- Resilience. If one CDN has an outage or congestion in a region, traffic moves to another.
- Performance. Different CDNs perform best in different countries and on different ISPs.
- Cost. You can send more traffic to the cheaper provider while keeping the other for quality.
- Negotiating power. Contracts are easier to negotiate when you can move traffic.
Steering can be done with DNS-based load balancing, with the player choosing between CDN URLs based on real-time performance data, or with a content steering specification that both HLS and DASH now support. For small platforms, multi-CDN is usually unnecessary; for major live events, it is standard practice.
Measuring CDN performance
Do not rely on marketing maps. Measure:
- Time to first byte (TTFB) for segments from different regions.
- Throughput for large segments, which affects which rendition players choose.
- Cache hit ratio, from CDN logs.
- Error rates (4xx and 5xx) per region.
- Player-side quality of experience: startup time, rebuffering ratio and average bitrate, gathered by player analytics.
A short trial with real traffic, split between two CDNs, tells you more than any benchmark page.
Summary
A video CDN delivers your segments from servers near your viewers, providing the scale, speed and origin protection that streaming needs. If you use a hosted video platform, a CDN is already included. If you self-host HLS or DASH for real audiences, you need one. Choose based on viewer locations, live support, security features, terms and full cost, and configure caching carefully for playlists and segments.
Frequently asked questions
Is a video CDN different from a normal CDN?
Mostly no. Video uses the same CDN infrastructure, but video-focused CDNs are tuned for large files, high throughput, live streaming, token authentication and features like origin shielding. Many general CDNs handle video very well.
How much does a CDN cost for video?
Prices range from under a cent to several cents per GB depending on provider, region and volume. Some providers bundle bandwidth into flat plans. Delivery to Asia, South America and Africa usually costs more than to North America and Europe.
Can I use Cloudflare for video streaming?
Cloudflare offers a dedicated product, Cloudflare Stream, for video. Serving large amounts of video through its standard CDN plans is restricted by its terms of service, so check them before using the general CDN for streaming.


