Course contentsShow
← Cloud and Infrastructure
Lesson 606 of 2,98911. CDN and Edge ComputingFree lesson

Range Requests and Partial Content

Enable support for HTTP range requests to allow resumable downloads and video seeking.

Range Requests and Partial Content

What you'll learn: How to enable HTTP range requests so users can resume interrupted downloads and seek through videos without re-fetching entire files.


The Core Idea

When you pause a large video download or scrub through a movie, you don't want to re-download everything from the beginning. Range requests let clients ask for specific byte ranges of a file instead of the entire thing, and the server responds with partial content (HTTP 206 status).

Think of it like borrowing chapters from a book instead of checking out the whole volume—you only get the pages you need right now.


How It Works

Your CDN must support the Range request header. A client sends:

GET /video.mp4 HTTP/1.1
Range: bytes=1000-1999

The CDN (or origin) responds with:

HTTP/1.1 206 Partial Content
Content-Range: bytes 1000-1999/50000
Content-Length: 1000

The client receives exactly 1000 bytes (positions 1000–1999 of the 50 KB file). If the connection drops, the client can resume with Range: bytes=2000-.


Configuration Requirements

To enable this in your CDN:

  1. Origin must support ranges — your origin server sends proper Accept-Ranges: bytes and Content-Range headers
  2. CDN must forward Range headers — configure your distribution to pass these headers to the origin
  3. Cache partial responses correctly — each byte range is cached independently based on cache keys that include the range

This is critical for video streaming, large software downloads, and mobile users with unstable connections.


Key Takeaway:
Range requests allow clients to fetch specific byte ranges of files, enabling resumable downloads and video seeking by having your CDN forward Range headers and properly cache partial content responses.