Newest feature of Next.js: Incremental Site Regeneration (ISR)


Jamstack Incremental Site Regeneration


I am sure you are already aware of the difference between Static Site Generation (SSG) and Server Side Rendering (SSR) and their benefits respectively. 

The key difference between the two is that SSG generates the HTML at build time, making it static, but allows for changes to UI using client-side scripting (JS) to make it dynamic whereas, SSR generates HTML on page request. The benefit of SSR is that it allows you to change HTML without requiring a build, which means you can continuously update the UI without requiring a build. 

This key difference makes SSG fast and performant and ideal for brochure ware sites, blogs, developer documentation etc. and make SSR comparatively slow but ideal for portals and dynamic applications.

Next.js does a great job of enabling both using React.

Now some say SSG should be the default way forward but there are reasons why SSR becomes a preferred approach.

However, with Next.js v9.5, a new feature was announced called Incremental Site Regeneration. This approach allows developers to execute static generation for each page without having to rebuild the entire site. This is ideal for ecommerce websites where you need to statically regenerate PDP pages more often than the rest of the website. Instead of waiting for the entire site to regenerate, which could take hours, you can incrementally regenerate the most performant PDP pages and the rest can be generated on-demand.

ISR doesn't really apply to small websites, but for large websites with millions of pages, it becomes the default approach.

Helpful links:

https://www.smashingmagazine.com/2021/04/incremental-static-regeneration-nextjs/

https://arunoda.me/blog/what-is-nextjs-issg


Comments

Popular posts from this blog

RESOLVED: Solr Exceptions - Document contains at least one immense term in field

First look at Sitecore XM Cloud: Part 4 - Creating a new Site

Is Rendered Item Valid XHtml Document Could not find schema information warnings during publish item Sitecore 7.2