Newest feature of Next.js: Incremental Site Regeneration (ISR)
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.
Post a Comment