Edge Computing for Low-Latency Video Delivery
The speed of light is a hard limit. When serving video content to users globally, routing requests back to a central server in us-east-1 introduces unacceptable latency.
Table of contents:
Cloudflare Workers
We moved our authentication and manifest rewriting logic from centralized Node APIs to Cloudflare Workers, executing Javascript just milliseconds away from the end-user.
Dynamic Ad Insertion
By parsing the HLS manifest at the edge, we can seamlessly stitch targeted advertisement segments into the video stream based on the user's localized session data.
Global State with Workers KV
Maintaining state across the edge is tough. We use Workers KV for eventually-consistent cache data and Durable Objects when strict consistency is required for concurrency control.