Payload Logo

generateStaticParams and the Cost of Guessing Wrong

Date Published

Wooden directional signpost with multiple arrows indicating different footpath and bridleway routes through a natural landscape

For a blog with fifty posts, enumerating every slug at build time is trivial. For a catalog with fifty thousand product pages, pre-rendering everything means a build that takes fifty thousand times longer than one page did — and most of that catalog might get ten visits a year.

The practical answer is usually a subset: pre-render the pages that actually get traffic, and let the rest render on first request and get cached from there. That's a genuinely different mental model from "static means every route is pre-built," and it's the part of the docs teams skim past until a build starts timing out.

Getting the subset wrong in the other direction — pre-rendering too little — just means the first visitor to a long-tail page pays a cold-render cost that a slightly larger build budget would have avoided entirely.