Next.js & technical SEO · Glossary
Static site generation (SSG)
Last updated June 30, 2026 · by Tal Gerafi
Static site generation (SSG) builds every page into a finished HTML file at deploy time, so the server sends pre-made files instead of rendering on each request. It makes pages load fast and stay cheap to serve.
Static site generation is a rendering strategy where your pages are turned into plain HTML files once, during the build, rather than assembled fresh for every visitor. When someone opens the page, the server hands back a file that already exists. There is no database query or template render at request time, so the page arrives fast and the same file can be cached close to the user on a CDN.
How does static site generation work?
At build time, the framework runs your code, fetches whatever data a page needs, and writes the result to a finished .html file (plus the JavaScript needed to make it interactive). That output is uploaded once and served as-is to everyone. In Next.js, a page is statically generated by default unless it opts into request-time data; the App Router decides this per route based on the data and functions you use.
The trade-off is freshness. Because the file is frozen at build, new content only appears when you rebuild and redeploy — a problem if data changes by the minute. Two patterns relax that: incremental static regeneration, which re-builds individual pages on a schedule or on demand, and server-side rendering, which renders per request when the data truly must be live. Choosing between them is the heart of static vs dynamic rendering.
Why static site generation matters for B2B sites
Most B2B and SaaS marketing pages — home, features, pricing, blog, glossary — change rarely and are read constantly. That is the ideal shape for SSG. Pre-built HTML gives you fast first paint, strong Core Web Vitals, and pages that are trivially cacheable and cheap at scale.
It also helps with crawling and AI search. A static page ships complete content in the initial HTML, so search engines and AI crawlers don't depend on running JavaScript to read it. Content that is present in the first response is generally simpler for crawlers to parse and for answer engines to quote. A common pattern for marketing sites is to default to static rendering and reach for ISR or dynamic rendering only where the content genuinely needs it, an approach covered in the guide to Next.js for marketing sites.
FAQ
Is static site generation the same as a static site?
Not exactly. A "static site" usually means hand-written or fully static HTML with no build step. Static site generation is a build process: a framework runs your code and data once and emits HTML files. The output is static, but it can be produced from dynamic data, components, and APIs.
When should you not use static site generation?
Skip pure SSG when a page must reflect data that changes between requests, such as a logged-in dashboard, live inventory, or personalized content. For those, server-side rendering renders per request. When content changes occasionally but not per visitor, incremental static regeneration re-builds individual pages without a full redeploy.
Does static site generation help SEO?
It helps indirectly. Pre-built HTML tends to load fast and produces strong Core Web Vitals, and complete content in the initial response does not depend on client-side JavaScript to be read. Those are favorable conditions for crawling and indexing, though rankings still depend on content quality, links, and intent match.