# Cache (/academy/cache)



Cache is the cheat sheet in your pocket.

The textbook — the [database](/academy/database), the origin [server](/academy/server) — has the truth. Looking it up is slow. So you copy a page onto a card and keep it close. Next time you need the answer, you read the card. That's a **cache**. The textbook never moved. You just stopped walking to it for every question.

The card is faster. The card can be wrong. If the textbook changed and you didn't recopy, you are performing last week's facts. That's the whole bug: "why is this old?"

**Where the card lives**

* Your browser caches images and JS so a refresh is not a re-download.
* A [CDN](/academy/cdn) is a cache for files, parked near the judge.
* Redis (or similar) is a cache for query results so the [backend](/academy/frontend-backend) skips the cabinet.
* [Prompt caching](/academy/prompt-caching/) is a cache for the long prefix of an [agent](/academy/agent) conversation, so you don't pay to re-read the whole brief every turn.

"Clear the cache" is not a spell. It means throw out the card and walk back to the textbook. Slower. Fresh. The site looks wrong because the judge's browser is still serving a copy from three [deploys](/academy/deploy) ago. The logo you "fixed" is still yesterday's logo on their laptop.

The [builder](/builder) will hand you a frontend that loves to cache. Fine. Know what you promised: how long the card is allowed to sit. If the score on the demo screen must be right this second, skip the shortcut. [State](/academy/state) that must be true belongs in the database, not on a card.

When caching works, pages feel instant and agent bills drop. When it's stale, you look sloppy — not broken in your [logs](/academy/log), broken in their eyes.

**What this unlocks**

A cache is always the shortcut, never the source. Once you know which one you're reading from, "why is this old?" stops being a mystery and starts being a timer you set. You can make the demo fast without lying, and you have a way to throw the card away when the truth moves.
