Visualizers

Learn by moving things

Interactive explainers for the ideas behind retrieval, embeddings, and agents. A formula tells you what is true; dragging a vector shows you why. Each one also appears inside the article it belongs to, and runs entirely in your browser, so drag, poke, and break it.

Portrait of Sachin Gupta rendered in binary

Pull CDN: fill on the first miss

From: CDNs: The Cache Nearest Your Users →

A pull CDN is cache-aside at the edge. The first request for a file misses, the edge fetches it once from the origin and keeps a copy, and every request after is a fast edge hit.

Pull CDN: fill the edge on the first missauto
requestedge PoPempty: MISSfetch onceoriginfill the edge

First request for this file at the edge: a miss. The edge fetches it once from the origin and keeps a copy on the way back.

A push CDN uploads content to every edge at deploy time, before anyone asks. Even the first request in a region is a hit, because you paid the cost up front. Good for high-traffic, stable assets.

Push CDN: pre-stock every edge ahead of timeauto
origindeployedge 1stockededge 2stockededge 3stockedpush at deploy

At deploy time you upload the file to every edge, before anyone asks for it.

The cache key decides what counts as the same request. By default it is the whole URL, so ?utm=fb and ?utm=tw become separate copies and wreck the hit rate. Normalize the key to ignore marketing params.

The cache key: what counts as the same requestauto
/logo.pngkey →slot A
/logo.png?utm=fbkey →slot B
/logo.png?utm=twkey →slot C
distinct cached copies: 3

By default the key is the whole URL, so ?utm=fb and ?utm=tw look like different files. Three near-identical requests, three separate copies, a wrecked hit rate.

Visualizers — Sachin Gupta