Reputation: 464
I'm using generateStaticParams to make all of my blog posts utilize SSG. When I update a blog I revalidate the path. When I create a new one I am also revalidating that path. Do I even need to do this? Will it automatically use SSG? Will it not use SSG until I rebuild and generateStaticParams runs again? I can't find anywhere in the docs that talks about this.
Upvotes: 0
Views: 28
Reputation: 640
When you create a new blog post you don't have need to rebuild whole project
just do on-demand revalidation
. Here's how it works:
SSG
at build time or in revalidate paths
.SSR
( slightly slower than SSG) and also immediately after rendering, cache
it on next.js server.serves it from cache
. This provides the faster SSG
experience.Now after the first request and caching it will be served as SSG. So, it becomes SSG eventually, but not immediately.
Worth noting: In some more complex scenarios where you might be doing pre-processing in generateStaticParams
, a rebuild might be necessary.
Upvotes: -1