Skip to catalogue

100

CDN

Static bytes cached near the user. HTML that changes per person usually does not belong there.

What is CDN?

A content delivery network caches responses at the edge. It wins for images, scripts, fonts, and public pages with a clear TTL. Personalized HTML and authenticated APIs are a different problem — caching those wrong leaks one user to another.

Why does CDN matter when vibe coding?

Models slap “add a CDN” on the whole origin. The next bug is a cached logged-in page. Name what is public, the cache key, and who purges it.

How do you do CDN?

Fingerprinted assets: long cache, immutable. HTML: short or bypass if it varies by cookie. Never vary a shared cache on nothing while the body depends on the user.

How do you ask a model for CDN?

CDN only for public (assets or pages). Cache key must include whatever changes the body. Do not cache responses that depend on a cookie unless the key includes it. Purge on publish.

What goes wrong with CDN?

Caching `/api/me` at the edge. One user’s profile becomes the world’s.

adjacent