Next.js Discord

Discord Forum

When is generateStaticParams even needed?

Unanswered
Polar bear posted this in #help-forum
Open in Discord
Polar bearOP
With generateStaticParams I can prerender dynamic pages at build time, say using values from a DB. But I feel like in most cases I would be continuing to add such values to the DB while the server is running, so I would still need to render pages at runtime which I would probably cache. Once these pages have been cached I get the same performance as those rendered at build time with generateStaticParams. So the only benefit of generateStaticParams over relying on caching is that the first (and only first) person to request that page since build gets an already prerendered page. This feels like a very small case. Have I misunderstood something? If not, can you list some real world examples where generateStaticParams is significantly useful? Thanks

2 Replies