May 14, 2026

Using CDNShark to Deliver Video and HLS Streaming Content

Why Your Streaming Origin Needs a CDN

When a video player requests an HLS stream, it does not download one large file — it continuously fetches small segment files (.ts or .m4s) plus a manifest (.m3u8 or .mpd) that tells it which segments to load next. As concurrent viewers increase, your origin server receives thousands of these small requests per minute. Without a CDN in front of it, the origin bears all of that load directly.

A pull zone CDN sits between your viewers and your origin. The first viewer's request fetches the segment from origin and caches it at the edge. Every subsequent viewer gets it from the cache — the origin only serves each unique segment once. This dramatically reduces bandwidth and CPU load on your streaming server.

CDNShark is a pull zone CDN with configurable caching, security controls, and a global edge network. This guide explains exactly how to configure it for HLS and video delivery.

Step 1 — Create a Pull Zone for Your Streaming Server

In CDNShark, go to Pull Zones → Create Zone and enter your streaming origin URL — this is the server running your HLS packager (nginx-rtmp, Wowza, AWS MediaPackage, or a simple file server). CDNShark will assign you a CDN hostname immediately.

Viewers point their players at the CDN hostname instead of your origin. Segment requests hit the nearest edge server first; if cached, they are served immediately without touching the origin.

Step 2 — Use a Custom Hostname

CDNShark lets you serve your pull zone from your own subdomain, for example stream.yourdomain.com. Create a CNAME record in your DNS pointing to the CDNShark hostname. SSL is terminated at the edge automatically — no certificate management needed on your end. Viewers see your brand domain throughout playback.

Step 3 — Configure Cache TTL for Video Segments

HLS segments are immutable once written — a segment named seg_000123.ts will never change. You can safely cache them for a long time. Set a high Cache TTL (for example 86400 seconds, 24 hours) on the zone so segments stay warm at the edge.

For live streams, the manifest file (playlist.m3u8) updates every few seconds. You do not want it cached. Use Custom Cache Rules to bypass cache for requests ending in .m3u8 or .mpd. CDNShark rules support matching by file extension, so this is a single rule: extension = m3u8, TTL = 0 (follow origin headers).

For VOD (video on demand) where manifests do not change, you can cache everything at a high TTL and use Perma-Cache to lock popular titles at the edge until you manually purge them after updating content.

Step 4 — Handle CORS for Browser-Based Players

Web-based video players (HLS.js, Shaka Player, Video.js) make cross-origin requests to fetch segments. CDNShark's built-in CORS header control lets you configure permissive, strict, or custom CORS policies per zone — no changes needed on your origin server. Enable CORS on the zone and players load segments without browser errors.

Step 5 — Control Who Can Watch with GEO Blocking

Content licensing often requires restricting delivery to specific countries or regions. CDNShark's GEO Blocking enforces this at the edge before any segment is delivered. You can either block listed countries (block mode) or restrict delivery exclusively to an approved list of countries (allow mode). Requests from blocked regions receive a 403 — nothing reaches your origin.

Step 6 — Protect Against Hotlinking

Anyone who finds your CDN URL can embed your stream in their own player. CDNShark's Hotlinking Protection lets you restrict delivery to approved referrer domains only. Requests from unlisted referrers are blocked at the edge. This prevents unauthorized use of your bandwidth without requiring token authentication on your origin.

Step 7 — Prevent Abuse with Rate Limiting and IP Controls

Automated downloaders and scrapers can exhaust your bandwidth by requesting every segment at high speed. CDNShark's Rate Limiting enforces per-IP request limits (configurable: Normal 50 req/s, Relaxed 200 req/s, Strict 10 req/s). Combine this with IP Blocking to permanently block known abusive addresses or CIDR ranges.

The Web Application Firewall (WAF) adds another layer — blocking scanner bots and path probing attempts before they consume any origin bandwidth.

Step 8 — Monitor Bandwidth and Cache Efficiency

CDNShark's Traffic Analytics dashboard shows bandwidth delivered, request counts, and cache hit ratios per zone over time. For a video pull zone, the cache hit ratio is the key metric — a high ratio (above 90%) means most viewer requests are served from edge cache, not your origin. If the ratio is low for a VOD zone, check that your cache rules are not accidentally bypassing segments.

What CDNShark Does — and Does Not — Do for Video

CDNShark is a general-purpose pull zone CDN optimized for caching and edge delivery. It is not a video transcoding service, a packaging server, or a DRM licensing platform. Your existing streaming infrastructure handles encoding, packaging, and DRM — CDNShark sits in front of it and caches the output at the edge.

This makes setup straightforward: your HLS origin continues to work exactly as before. You simply route player traffic through CDNShark. No changes to your encoder or packager are required.

Summary: CDNShark Configuration for HLS Delivery

SettingRecommended Value
Origin URLYour HLS packaging server
Cache TTL86400s for VOD; lower (300s) for live segments
Cache Rule — .m3u8 / .mpdBypass cache (TTL = 0) for live; cache for VOD
CORSEnabled (permissive or custom origin list)
GEO BlockingAllow-list licensed countries if required
Hotlinking ProtectionAllow-list your player domains
Rate LimitingNormal or Strict depending on expected concurrency
Custom HostnameCNAME stream.yourdomain.com to CDNShark

Get Started

CDNShark includes all features on every plan — pull zones, cache rules, GEO blocking, hotlinking protection, rate limiting, WAF, and traffic analytics. No add-ons, no per-feature pricing. Create a pull zone for your streaming server today and offload your origin in minutes.

Recent Posts

May 14, 2026

What is CDN?