We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Web Content Delivery
Free preview: the first 2 parts of this 6-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Web Content Delivery
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
Static Site Generation (SSG) builds every page at deploy time. A blog with 100 posts? Build all 100 pages as HTML, push to , serve instantly. But what if you have 500,000 product pages on an e-commerce site? Building all of them takes hours. And when one product's price changes, you rebuild the entire site just to update one page.
Server-Side Rendering (SSR) generates pages on every request. Fresh data guaranteed. But every request hits your server, queries your database, renders HTML. At 10,000 requests per second, that is 10,000 database queries per second. Your origin server becomes the bottleneck, and page load times spike when traffic surges.
ISR combines the best of both. Build pages at deploy time like SSG. Serve them from CDN like SSG. But when the cached page is stale, regenerate it in the background without blocking the user. The current user gets the stale page instantly. The next user gets the fresh page. You get CDN-speed delivery with near-real-time data freshness.
Next.js introduced ISR in version 9.5 (2020). Vercel, Netlify, and Cloudflare Pages all support variants of it. This platform (the one you are reading right now) uses ISR for all 754 lesson pages.
The four rendering strategies sit on a spectrum from "always static" to "always dynamic."
SSG. Build once, serve forever. Fastest possible TTFB (Time to First Byte) because the page is pre-built HTML on a edge. But content is frozen at build time. Rebuilding takes minutes to hours for large sites. Best for: marketing pages, documentation, blog posts that rarely change.
ISR (time-based). SSG with a revalidation interval. After N seconds, the next request triggers a background rebuild. The user who triggered it gets the stale page. The next user gets the fresh page. Best for: product pages, listing pages, any content that changes periodically but does not need real-time accuracy.
On-demand revalidation. ISR but triggered by an event (webhook, CMS publish) instead of a timer. When an editor publishes a blog post, the CMS calls your revalidation endpoint, and the specific page rebuilds immediately. No waiting for a timer. Best for: CMS-driven sites where editors expect instant updates.
SSR. Render on every request. Always fresh. But every request hits your origin. Best for: dashboards with real-time data, personalized pages, search results.
| Strategy | TTFB | Data freshness | Origin load | Best for |
|---|---|---|---|---|
| SSG | 10-50 ms (CDN) | Stale (build time) | Zero | Docs, marketing |
| ISR (time) | 10-50 ms (CDN) | Stale by up to N seconds | Very low | Product pages, listings |
| ISR (on-demand) | 10-50 ms (CDN) | Fresh within seconds of publish | Very low | CMS content, blog |
| SSR | 100-500 ms (origin) | Always fresh | High | Dashboards, search |
It is easy and good
“It is really nice and good Please join the course”