Topic starter
Caching in a CDN is the process of storing copies of your website’s content on multiple edge servers so it can be delivered to users quickly without repeatedly fetching it from the origin server.
Instead of generating or downloading the same content every time:
- The CDN saves (caches) a copy
- Future users get that copy instantly from a nearby server
How it works
- A user requests a file (e.g., image, CSS, JS).
- CDN checks:
- If cached (cache hit) → returns it immediately ⚡
- If not cached (cache miss) → fetches from origin server, stores it, then delivers it
- Next users get the cached version.
What gets cached?
Typically:
- Images
- Videos
- CSS & JavaScript files
- Fonts
- Static HTML
Some CDNs (like Cloudflare or Amazon CloudFront) can also cache dynamic content with proper configuration.
Cache expiration (TTL)
Cached content isn’t stored forever. It uses TTL (Time To Live):
- After TTL expires → CDN fetches a fresh copy from origin
- Ensures users don’t see outdated content
Cache control
Developers control caching using HTTP headers:
Cache-ControlExpiresETag
Benefits of CDN caching
- Faster performance (instant delivery)
- Reduced server load (fewer origin requests)
- Lower bandwidth costs
- Better scalability
Posted : 05/04/2026 8:38 am
