ISR, On-Demand Revalidation & stale-while-revalidate for Large SEO Catalogs
Pure build-time SSG stalls at 50,000 pages while dynamic SSR spikes origin latency. Combining On-Demand ISR with edge stale-while-revalidate unlocks instant TTFB.
Dmitry K., Technical SEO Lead · SEO Space
Indexation benchmark targets
- Cached TTFB
- < 80 ms worldwide
- Purge latency
- < 2s on price/stock edit
- Build bottleneck
- Top 5k static, rest ISR
- Bot cache hit
- > 95% Googlebot hits
1. Why Pure SSG Breaks Above 20,000 Indexable Routes
Full static site generation (SSG) delivers unbeatable TTFB for marketing sites, yet rebuilding 100,000 e-commerce SKUs or marketplace profiles on every copy edit quickly stretches CI builds past 45 minutes—delaying urgent price updates and sitemap freshness.
Conversely, hitting a relational database per Googlebot request degrades under bot bursts and elevates TTFB beyond Google’s preferred threshold.
- Pre-build your top 2,000–5,000 highest-traffic hubs and top revenue URLs during deployment.
- Generate long-tail URLs lazily on first visit and promote cached HTML to regional CDN edge nodes.
- Never use blind time-based 60-second revalidation if inventory changes rarely; prefer webhook-triggered tag invalidation.
2. On-Demand Tag Revalidation & HTTP Cache-Control Patterns
Attach deterministic cache tags (e.g., `product-4821`, `category-saas`) when rendering HTML so your CMS or ERP webhook invalidates only impacted routes in under 2 seconds—preserving warm cache across the remaining 99.9% of the domain.
// CDN edge Cache-Control for catalog HTML
Cache-Control: public, max-age=0, s-maxage=3600, stale-while-revalidate=86400
// Next.js / Edge on-demand tag invalidation webhook
export async function POST(req: Request) {
const { tag, secret } = await req.json();
if (secret !== process.env.REVALIDATE_SECRET) return new Response('Unauthorized', { status: 401 });
revalidateTag(tag);
return Response.json({ revalidated: true, tag });
} 3. Protecting Crawlers from Stale Prices & Personalized Cache Leaks
Ensure HTML cached for public search bots never embeds user-specific session names, cart counts, or currency overrides without proper `Vary` segmentation or client-side hydration of personal drawers only.
| Rendering Model | TTFB Speed | Best Fit Scale |
|---|---|---|
| Pure Static Pre-render | 10–40 ms | Up to 5,000 pages (Corporate, Agency, Blogs) |
| On-Demand ISR + Tag Purge | 30–90 ms | 10k to 500k+ pages (E-commerce, Marketplaces) |
| Dynamic SSR (Uncached) | 250–900 ms | Avoid for public indexable SEO templates |
Need this indexation setup audited on your domain?
Send your website URL. We check raw HTML parity, log crawl hits, canonical discipline, and sitemap architecture manually within 24 hours.