Cloudflare Pages: how do I guarantee byte-range (206) responses for MP4 files for Safari / iOS app playback?

  • Thread starter Thread starter Floyd Xiao
  • Start date Start date
F

Floyd Xiao

I run a website on Cloudflare Pages (Direct Upload deployments). The site is mostly used as an installed PWA on iPhones/iPads, and it plays plain static MP4 files with native players — no streaming service, no HLS.

One video wedges in the iOS app context: frames render and audio plays, but the timeline never establishes, the native controls do nothing, and the audio continues after the app is closed. The same file plays perfectly in mobile Safari on the same devices, its English twin works in the app, and a re-encoded copy under a brand-new filename fails identically — so suspicion has moved to how the file is delivered to the in-app (WKWebView) media stack.

What I have measured:

  • A curl range probe against production returns a correct 206 Partial Content with Content-Range.
  • The same probe against the Pages test subdomain returns 200 with the full body — for the working and the failing file alike.
  • Cloudflare's documentation says range-request support for Pages is still in progress, and notes that some clients, Safari in particular, need range support to play video.

Questions for other site owners:

  1. On Cloudflare Pages, what actually decides whether a media request gets a 206 or a 200 — the deployment, the cache state of the object, the point of presence, the client?
  2. Is there a supported way to guarantee spec-compliant range responses for a path like /video/* on Pages — for example a Worker in front of the assets, a specific cache setting, or a per-object cache purge?
  3. Has anyone seen an edge-served MP4 behave in Safari but wedge in a WKWebView on the same device, and traced it to the delivery layer?

The file itself is a standard H.264/AAC faststart MP4 that decodes without errors. An example: https://trocaly.com/video/trocaly-help-how-to-give-guide-fr.mp4

Continue reading...
 
Back
Top Bottom