Nextjs SSG 10 milion records

Viewed 1083

I have next js app & I have an API that returns 10 million posts, I want to know that is it standard that I using the SSG method to do that? plus I may add posts at any time.

1 Answers

Continuing from the comments,

Most likely with your current implementation, you probably have the following disadvantages:

  1. It takes more time to build the app
  2. To add new content or update existing, we need to rebuild the app

However, there are new options being developed to overcome some of the disadvantages

Incremental Static Generation - Fallback Mode - It can generate a set of pages at the build time but it can also generate new pages on-demand as needed.

Incremental Static REgeneration - Next.js can rebuild these pages on-demand as it gets requests. But unlike SSR, they do not generate on every page request. You can set a timeout called unstable_revalidate in seconds.

You can find out more at - https://arunoda.me/blog/what-is-nextjs-issg

Related