NextJS ISR vs SSG

Hello,

I read this article. I’m confuse about ISR (Incremental static regeneration) and SSG (Static site generation).

I’m working on simple website. Main pages will include companies list and every company has their details page. I can create new company and update existing company’s infos.

I’m planning create details page with SSG for every company. But If I add new company to table, details page for new company wont be access until next build.

  • So If I use ISR approach can details page created for new company without build?
  • If this is possible, will the newly created page be stored in the local repository?
  • What is the local storage size limitations for statically generated pages? For example can i create 10000 pages with SSG and store in Netlify?

Hey @bk52,

Glad you asked, here is some additional info about it:

Yes, the page will be generated on-demand and then cached for further visits/requests. You can create a dynamic page, that would use the slug from the URL and send a request to your API (or table as you say) to fetch the details and build the page with that data.

No, that is something you’d have to handle yourself. Depending on how your site is structured, you might or might not need this. For example, if you use a CMS to store all this data, you just need to create 1 dynamic page which would be the template for all of the company pages. As soon as a page is requested, as I said above, you can generate it on the server-side using ISR. This can eliminate the need to store the page in your repo. But if you absolutely need the page to remain in your repo, you’d have to create a separate workflow to save the page from your table to your repo.

No limits - we do have a 54,000 assets per folder limit, but the total number of folders per site are unlimited. This 54k limit is being worked on to be eliminated too.

2 Likes

Thank you. The answer really answered the questions I had in my mind.

1 Like