Technologies
Next.js Static Site Generation
Static generation builds the HTML for a page once, at build time, and serves that same file to every visitor from a CDN edge — no server render on request, no database query per visit. It's the fastest rendering strategy Next.js offers, and the right default for any content that doesn't change per user.
Marketing pages, blog posts, documentation, and most of the SEO-targeted content on a site fall into this category.
How It Works
- arrow_rightPages are rendered to static HTML at build time, not on each request
- arrow_rightgenerateStaticParams tells Next.js which dynamic route params to pre-render (e.g. every blog post slug)
- arrow_rightOutput is plain HTML/CSS/JS that can be served from a CDN with no server compute per request
- arrow_rightContent updates require a rebuild, unless combined with incremental static regeneration
Why It's Strong for SEO
Static pages are the fastest thing you can serve — no render latency, no cold starts, no database round trip. Since page speed factors into ranking and directly affects bounce rate, static generation is usually the strongest starting point for any content page whose primary goal is organic search traffic.
Common Mistakes
- arrow_rightReaching for SSR by default when the content doesn't actually change per request
- arrow_rightNot using generateStaticParams for dynamic content pages, forcing them to render on-demand instead of at build time
- arrow_rightForgetting that a fully static site needs a rebuild (or ISR) to reflect content changes — a common surprise for teams used to a traditional CMS with instant publishing
Frequently Asked Questions
How does static generation handle dynamic routes like blog posts?add
generateStaticParams returns the list of param values (e.g. every post slug) Next.js should pre-render at build time, producing one static HTML file per post — the routes are dynamic in code, but static in output.
What happens when content changes after the build?add
A fully static page won't reflect the change until the next deploy, unless it's set up with incremental static regeneration, which lets Next.js re-generate a page in the background after a defined interval or on-demand trigger.
Is static generation suitable for a large site with thousands of pages?add
Yes, with generateStaticParams and, if build times become a concern at very large scale, ISR to generate less-visited pages on demand instead of all upfront — that keeps builds fast while still serving static output for everything.