---
title: "The CDN Request Path: From Edge Hit to Chunk-Aligned Origin Fill"
description: "A CDN turns one client request into a short ordered pipeline: edge routing, cache-key lookup, request coalescing, chunk-aligned origin fetch, and a cached response for the next caller."
---

# The CDN Request Path: From Edge Hit to Chunk-Aligned Origin Fill

**Type:** [How it works](https://yomu.fyi/visual-explainers/category/how-it-works.md)

![Six-step left-to-right CDN request flow: client request, edge routing, policy and cache-key check, hit served from edge, miss with coalescing and aligned range fetch, then tiered cache and origin fill. A coordinator panel merges cache, in-flight, and origin bytes, with a back arrow storing the response for reuse.](https://yomufyi.s3.us-east-1.amazonaws.com/visual-explainers/fa530c02-51bf-481a-9097-e8e88c077f1f/image-337ff1dd-1814-4419-8006-e4d14ebef826.webp)

> A CDN turns one client request into a short ordered pipeline: edge routing, cache-key lookup, request coalescing, chunk-aligned origin fetch, and a cached response for the next caller.

## Explanation

Most CDN explanations stop at 'cache it at the edge'; the interesting part is what happens on a miss. This explainer traces a single request through six stages: client request, edge routing to a nearby node, the policy and cache-key check, a cache hit served straight from the edge, a miss that coalesces concurrent requests and aligns byte ranges to fixed chunks, and a tiered-cache or origin fill that stores the response for the next caller. It also shows where the edge must stay correct, checking entity tags before combining bytes from cache, in-flight downloads, and origin, and failing closed when a required key is missing. The payoff is concrete: better range alignment halved p99 time to first byte for one object store and cut tiered-cache traffic by roughly six percent.

## FAQ

### Why can a small byte-range request pull far more data from the origin?

Fixed-chunk caching can mismatch a client's byte range, so a small seek may pull a much larger object; Cloudflare describes a few megabytes of client request triggering a 128 MiB origin fetch. Aligning the client range to chunk boundaries and fetching only the aligned chunk removes that waste, and it halved p99 time to first byte for one object store.

### What must the edge verify before it serves or combines bytes?

A coordinator merges bytes from cache, in-flight downloads, and origin responses, checks entity tags, and refuses to combine them across representation changes. Where decryption keys are geographically fenced, edge servers that lack the required regional key fail closed instead of serving the request.

### Is running your own edge cache worth it?

Often yes: XeDN ran across 35 datacenters on three 256 MB Machines for a year, fetching missing files from object storage, shifting traffic to tolerate individual node failures, and scaling to zero when idle. Heroku's modern web app reference architecture likewise treats a CDN as a standard component alongside an API gateway and object storage.

**Tags:** [Anycast](https://yomu.fyi/topic/anycast.md), [Caching](https://yomu.fyi/topic/caching.md), [CDN](https://yomu.fyi/topic/cdn.md), [Edge Computing](https://yomu.fyi/topic/edge-computing.md), [Latency](https://yomu.fyi/topic/latency.md), [Pingora](https://yomu.fyi/topic/pingora.md)

## Related reading

### [Origin Range Requests: Serving large files without range-request tuning](https://yomu.fyi/post/origin-range-requests-serving-large-files-without-range-request-tuning.md)
- Company: [Cloudflare](https://yomu.fyi/company/cloudflare.md)
- Author: Matthew Gumport
- Published: Oct 23, 2026
- Type: Announcement

Naive byte-range caching in CDNs can waste huge bandwidth when a small client request triggers a large origin fetch—for example, a seek request for a few megabytes could pull 128 MiB. Cloudflare’s previous implementation used fixed range sizes that created tradeoffs; the size was part of the cache key, so updates invalidated entries, and it could not combine with concurrent streaming, forcing downloads before serving. The new Origin Range Requests feature, a self-service option with no tuning, uses Pingora’s fixed-size chunks to align client ranges to chunk boundaries and fetch only the aligned chunk. A coordinator merges bytes from cache, in-flight downloads, and origin responses, checking entity tags and refusing to combine across representation changes. Enabling Origin Range Requests halved p99 time to first byte for R2, cut tiered cache traffic by roughly 6 percent, reducing petabyte-scale daily data movement.


### [Bringing post-quantum cryptography to geographically fenced key management](https://yomu.fyi/post/bringing-post-quantum-cryptography-to-geographically-fenced-key-manage.md)
- Company: [Cloudflare](https://yomu.fyi/company/cloudflare.md)
- Author: Erik Engstrom
- Published: Oct 23, 2026
- Type: Announcement

Cloudflare launched a post-quantum GeoKey Manager in closed beta for its Data Localization Suite to protect decryption keys from harvest now, decrypt later attacks. The system uses hybrid ML-KEM-768 and X25519 cryptography, combining a NIST-standard post-quantum scheme with classical encryption to wrap each regional root key. Regional root keys are symmetric secrets tied to one geography and distributed to authorized edge servers via a separate provisioning service, not through the global Quicksilver system, with membership refreshed daily. Servers missing a required key fail closed, rejecting requests or failing to start, guaranteeing keys never leave the region; each wrapped private key carries metadata for service context and epoch. General availability is planned for Q1 2027, with integrations for Cloudflare One and CDN under development, and existing DLS customers can register for testing.


### [Locking down MCP at the gateway](https://yomu.fyi/post/locking-down-mcp-at-the-gateway.md)
- Company: [Red Hat](https://yomu.fyi/company/red-hat.md)
- Author: David Martin, Jason Madigan
- Published: Oct 23, 2026
- Type: Tutorial

Model Context Protocol (MCP) allows an agent to use tools across enterprise systems, but a shared MCP gateway requires a policy boundary beyond authentication. The article describes using Red Hat Connectivity Link (RHCL) AuthPolicy to validate OIDC or JWT credentials and then authorize per-tool access based on roles in the identity provider claims. NetworkPolicy controls which workloads can communicate with the gateway and MCP servers, while RateLimitPolicy limits request volume. Gateway isolation can be achieved with separate gateway instances or a shared gateway with isolated listeners, each with its own MCPGatewayExtension. These controls map to OWASP risks for LLM and agentic applications, including excessive agency, unbounded consumption, tool misuse, and identity abuse.


### [How I Fly](https://yomu.fyi/post/how-i-fly.md)
- Company: [Fly.io](https://yomu.fyi/company/fly-io.md)
- Published: Nov 17, 2023
- Type: Explainer

This article describes how Xe Iaso uses Fly.io to host a blog, CDN, and experimental personal projects while deploying services near users. The blog backend runs in Toronto, while XeDN runs in 35 datacenters, fetches missing files from Backblaze B2, and uses caching and traffic shifting to tolerate individual node failures. Arsène runs every 12 hours, asking the ChatGPT API for posts, using Stable Diffusion for illustrations through an Automatic1111 API on a private network, then sending images to XeDN for global delivery. The setup emphasizes reusable, interoperable building blocks rather than isolated projects, with Fly.io handling deployment, networking, and scaling concerns. Xe reports that three 256 MB Machines ran XeDN for a year, while Arsène still runs on one, and says applications can scale to zero when idle.


### [Beyond Web and Worker: Evolution of the Modern Web App on Heroku](https://yomu.fyi/post/beyond-web-and-worker-evolution-of-the-modern-web-app-on-heroku.md)
- Company: [Heroku](https://yomu.fyi/company/heroku.md)
- Author: Chris Castle
- Published: Aug 14, 2018
- Type: Explainer

Over a decade, the standard Heroku web application has expanded from a web process, database, worker, and Redis queue into a broader architecture for web, mobile, data, and operational demands. The post connects this shift to snappier single-page experiences, native smartphone apps, APIs as integration surfaces, growing streaming data, increasing system complexity, and scale. Its proposed components include a content delivery network, API Gateway, Apache Kafka, object storage, data warehouses, and query or visualization tools, alongside service-oriented architecture and scalable-first design. The architecture separates functionality into smaller services for adaptability, while acknowledging that more components create more scaling and operational levers. It presents Heroku’s PaaS and managed services as a way to reduce that burden, then leaves deployment, communication, CI/CD, monitoring, and security as topics for follow-up posts.
