What is a CDN, and how does it improve performance?
EasyConceptStorage & CDNs
Answer
A content delivery network (CDN) is a globally distributed set of edge servers that cache content close to users. Requests are routed to a nearby edge, so content travels a shorter distance and the origin server handles far less traffic.
- Content: static assets such as images, video segments, CSS and JavaScript, and sometimes cacheable API responses.
- Pull CDN: the edge fetches from the origin on the first miss and caches according to
Cache-Controlheaders; easy to operate. Push CDN: you upload content in advance; suited to large, predictable files. - Invalidation: use versioned file names such as
app.3f2a.jsinstead of purging caches on every release. - Extra benefits: absorbing traffic spikes and DDoS attacks, and terminating TLS close to users.