Deferred Static Generation (DSG)

This page opts into Gatsby's Deferred Static Generation (DSG). When you hit it for the first time, it renders on demand with Cloud Functions, caches the result to Firebase Storage, and serves the cached HTML on subsequent visits.

DSG is ideal when you have a large collection of pages that rarely change: docs, catalogs, long-tail marketing pages, or product detail views. Instead of waiting for everything at build time, you generate pages lazily the first time a visitor needs them.

  • Config: mark the route in gatsby-node.js using the defer option.
  • Caching: the adapter stores the rendered HTML to Cloud Storage so future visitors see CDN-speed responses.
  • Freshness: redeploy to invalidate the cache, or clear the cache manually from Firebase Storage Dashboard.

Tip: Combine DSG with Firebase Hosting preview channels to test new content without warming production caches.