Static Site Generation (SSG)
What is Static Site Generation (SSG)?
Static Site Generation pre-renders every page to plain HTML at build time, ahead of any user request. The resulting files are uploaded to object storage or a content-delivery-network-cdn and served as cacheable, deterministic responses. For commerce, SSG works best on content that changes on editorial rather than transactional time scales.
Definition
During the build step, the framework crawls a set of routes, fetches data from commerce APIs, the content-management-system-cms and product catalogs, and writes a self-contained HTML document plus a hydration bundle per page. Tools like Next.js getStaticProps, Astro, Nuxt nuxt generate, Gatsby and Hugo are typical SSG implementations. Pages are served from edge caches with TTFB in the tens of milliseconds and zero render cost. SSG is a cornerstone of jamstack and pairs naturally with a content-delivery-network-cdn for global distribution.
Why it matters
SSG removes the runtime render cost entirely, which translates to predictable TTFB, easy horizontal scaling and lower hosting bills. For Core Web Vitals it is the most forgiving rendering strategy because LCP is mostly bound by asset delivery. It is the right choice for marketing pages, glossary entries, brand stories, SEO landing pages and evergreen category content. SSG also tightens the security surface, because there is no live runtime per request. The trade-off is freshness: any catalog change requires a rebuild, which limits SSG for inventory-sensitive PDPs.
Use cases
Composable-commerce teams typically SSG their landing-page network, blog, help centers and lower-traffic category pages on Astro, Next.js or Nuxt, then deploy them through Vercel, Netlify or Cloudflare Pages. Webhooks from a headless CMS trigger incremental builds when editors publish, so TTFB stays near-zero while content stays fresh. For PDPs, teams either move to ISR for finer-grained revalidation or combine SSG shells with client-side fetches for stock and pricing. SSG is also the default for jamstack reference architectures that pair Hygraph, Sanity or Contentful with a static frontend.
Related
Explore Composable Headless Frontend · Performance and Core Web Vitals.