I have a blog with ~5K posts and even more pages. All content is stored in a headless CMS and right now we use Gatsby to generate all pages. Is SSG implementation in Next.js suitable for handling such amount of content?
Yes this is definitely possible. One of the exciting things about the 9.3 release is that it also added support for on-demand generating additional static pages through the fallback property. You can find more about that here: nextjs.org/docs/basic-features/data-fetching
Using the fallback property allows you to generate a subset of pages (e.g. the most popular posts or products) and generate the rest of the pages when a request comes in.
Tim Neutkens Thanks! Is there a way to invalidate specific static pages, e.g. when content in CMS is modified? Or would it require a new deployment to remove outdated static pages?
Szymon Nowak I would like to mention that I just finished transferring a site with 21k posts, tags, category pages from Gatsby.js to ZEIT Next.js. The build time went down 23 mins. The entire experience with the fallback hybrid SSR on top of SSG has been amazing. I wish I wasn't under an NDA in this project and could post about it. What I can tell however is that this is a path well worth exploring.
Ahmad Awais ⚡️ Thanks! That's reassuring ;) I wasn't aware of the fallback option and was afraid that I'd have to basically rewrite Gatsby source plugin for the headless CMS we use... Do you pre-generate any static pages (e.g. the latest or most popular posts) or do you use fallback option for all? Can you tell how you handle content updates given that "Incremental Static Generation" is still in progress? Redeploy the whole app?
Szymon Nowak We are waiting for that to happen. Write now it rebuilds the entire site. The previews are using the preview feature that got released in the v9.3.