Videos and large files on your site can now be seeked and resumed

FixedCDNv0.0.103

Files inside a site ignored range requests, so a video couldn't be seeked and Safari wouldn't play it at all. The edge now sends just the part of a file that was asked for. HTML pages are still always sent whole.

Browsers ask for part of a file with a range request: to skip ahead in a video, to resume an interrupted download, or, in Safari’s case, before playing a video at all. Files inside your site answered every range request with the whole file, so a <video> couldn’t be seeked and Safari wouldn’t play it.

The edge now answers a range request for a file in your site with just those bytes:

Range: bytes=10-29     →  206  Content-Range: bytes 10-29/10388
Range: bytes=999999-   →  416  Content-Range: bytes */10388

Checked on a live site: a partial request returns 206 with the requested bytes, and a range past the end returns 416 with the file’s real length, so the browser can correct itself.

Resuming is safe across deploys. A browser resuming a download sends If-Range with the version it started with. If you’ve deployed since, it gets the whole new file instead of the end of the new one stitched onto the start of the old.

Limits

  • HTML is always sent whole. The edge adds a few lines to every page as it serves it, so a byte offset into a stored page doesn’t match the page a browser receives. HTML responses don’t advertise range support.
  • One range per request. A request for several ranges at once gets the whole file, as the HTTP standard allows.

← All changes · More CDN changes · Subscribe to CDN