# CDNs & Edge — System Design: Architecture, Scale and Trade-offs

Source: https://www.skillbyai.com/en/system-design/sd-cdn

> Serve static and cacheable content from the edge with a CDN, compare pull and push models and use hashed filenames.

## What a CDN does

A CDN caches copies of your content in points of presence worldwide. Users fetch from the nearest edge, cutting latency and offloading your origin.

## Push vs pull

**Pull**: CDN fetches from origin on first miss, then caches. **Push**: you upload assets to the CDN ahead of time. Pull is the common default.

## Version your asset URLs

Put a content hash in the filename (`app.9f2c.js`). New deploy = new URL = no stale cache, and you can cache forever.
