api-design
This skill should be used when the user needs to "design the API", do "endpoint design", pin down a "request/response shape", choose a "pagination" strategy…
This skill should be used when the user asks about a "CDN", "edge caching", "static asset delivery", "media / video delivery", "geo distribution of content" or "edge POP selection", "push vs pull CDN", "cache-control headers" / "TTL for static assets", "origin offload", or
$ npx -y skills add proyecto26/system-design-skills --skill content-delivery --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/content-deliveryContext preview
The summary Claude sees to decide when to auto-load this skill.
This skill should be used when the user asks about a "CDN", "edge caching", "static asset delivery", "media / video delivery", "geo distribution of content" or "edge POP selection", "push vs pull CDN", "cache-control headers" / "TTL for static assets", "origin offload", or
name: content-delivery description: This skill should be used when the user asks about a "CDN", "edge caching", "static asset delivery", "media / video delivery", "geo distribution of content" or "edge POP selection", "push vs pull CDN", "cache-control headers" / "TTL for static assets", "origin offload", or "origin shield". It gives the recipe for serving bytes from the edge close to users. Use it whenever a design serves images, video, JS/CSS, or downloads to a wide geography, or the origin is saturated by repeat reads of the same files, even if the user doesn't say "CDN".
Push bytes to the network edge so requests terminate close to the user and never reach the origin. A CDN is the outermost cache layer of a system: get it right and most static/media traffic and a chunk of latency vanish before they hit your servers; get it wrong and you serve stale assets, leak origin load, or pay egress twice.
The same files (images, video, JS/CSS bundles, downloads, fonts) are read repeatedly by a geographically spread audience; the origin or its bandwidth is the bottleneck for static reads; or cross-region latency on first byte hurts (a cross-continent round trip is ~100 ms — see `back-of-the-envelope`). A CDN buys latency *and* origin offload at once.
Highly personalized, per-request dynamic responses with no cacheable shape (a CDN adds a hop and caches nothing). Tiny single-region audiences where the origin already serves reads comfortably (YAGNI — a CDN is another vendor, another bill, another invalidation problem). Strictly fresh data that cannot tolerate any staleness window — that belongs at the origin or behind `consistency-coordination`, not a TTL-based edge. Naming a CDN before a number shows static reads or geography is the problem is a red flag.
dynamic/personalized? (Only the cacheable part benefits.)
stale may an edge copy be? (Drives TTL and invalidation strategy.)
and geo-routing matter at all.)
sizes the bill and the offload (→ `back-of-the-envelope`).
survive a cold-cache stampede if the edge flushes?
**Distribution model — how content reaches the edge**
the rest. *Use when* traffic is high and content is large or churny — the edge holds only what's actually requested. The default for most systems.
*Use when* the catalog is small/static or launch spikes can't tolerate a cold first-miss (you pre-warm); you accept managing storage and uploads yourself.
**Caching key & TTL — what the edge keys on and for how long**
assets cached for months; a content change is a *new URL*, not an invalidation. *Use when* you control asset URLs — the cleanest model.
changes on a schedule. *Use when* URLs are stable but content updates.
**Edge proximity & routing — how a user reaches the nearest PoP**
*Use when* the audience is multi-region (almost always, for a CDN). Shared with `load-balancing` — see there for the routing mechanics.
**Origin protection — shrinking the origin's exposed surface**
origin that all edges pull through, collapsing N edge misses into one origin fetch. *Use when* origin offload or stampede protection matters more than a little extra latency on cold misses.
| Option | What it solves | What it worsens | Change it when | |---|---|---|---| | Pull CDN | Edge holds only requested content; no upload pipeline | First request per object is a slow miss; redundant re-pulls when TTL expires before content changes | Cold-miss latency or launch spikes hurt → push / pre-warm | | Push CDN | No cold miss; full control of what's cached and when | You own upload + storage + URL rewriting; pay to store rarely-read assets | Catalog grows or churns → pull | | Long TTL + fingerprinted URLs | Near-permanent caching; updates are new URLs (no invalidation race) | Requires build/URL control; old versions linger at edge until aged out | URLs are not under your control → short TTL | | Short TTL / stale-while-revalidate | Bounded staleness on stable URLs | More origin revalidation traffic; synchronized expiry can stampede | Content is truly immutable → fingerprint + long TTL | | Geo-routing / anycast | Users hit the nearest edge; lower latency | More PoPs to reason about; routing can send users to a degraded PoP | Single-region audience → skip it | | Origin shield | Collapses edge misses into one origin fetch; protects origin | Extra hop on cold path; the shield is a new chokepoint/SPOF if single-region | Origin is robust and offload is already enough → drop it |
A CDN usually *absorbs* load spikes — that's its job — but it has its own failure shapes, and they tend to dump straight onto the origin.
expiry, edge hit rate craters and every PoP pulls from the origin at once. This is a `caching` thundering herd at global scale. *Mitigate:* origin shield to collapse misses, TTL jitter, `stale-while-revalidate` so the edge serves stale while it refetches, staged purges.
Design scalable systems the way strong engineers actually do — by reasoning, not by memorizing diagrams.
Repo: proyecto26/system-design-skills
This skill should be used when the user needs to "design the API", do "endpoint design", pin down a "request/response shape", choose a "pagination" strategy…
This skill should be used when a system design needs a diagram — "draw the architecture", "diagram this system", "show the components", "make an…
This skill should be used when the user needs to "estimate QPS", "back-of-the-envelope" (BOTEC) numbers, "how much storage / bandwidth", "how many servers",…
This skill should be used when the user wants a "blob store" or "object storage", names "S3" or an S3-compatible store, needs to "store images / video /…
This skill should be used when the user asks about a "caching strategy", "cache invalidation", "what to cache", "read-through vs write-through vs write-back",…
This skill should be used when the user asks about the "CAP theorem", "PACELC", a "consistency model", "eventual vs strong consistency", "read-your-writes",…