Share:
Notifications
Clear all

What is caching in a CDN?

1 Posts
1 Users
0 Reactions
8 Views
(@gauzkhas)
Posts: 16
Active Member
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

  1. A user requests a file (e.g., image, CSS, JS).
  2. CDN checks:
    • If cached (cache hit) → returns it immediately ⚡
    • If not cached (cache miss) → fetches from origin server, stores it, then delivers it
  3. 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-Control
  • Expires
  • ETag

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
Share: