# CDNs & Edge — System Design

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

> Serving static and cacheable content near the user.

## 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.
