Nice article. You could also say a word about using getStaticProps with Incremental Static Regeneration which allows you to use both statically generated content with dynamic updates when needed.
Here's what Next.JS documentation says about it: Inspired by stale-while-revalidate, background regeneration ensures traffic is served uninterruptedly, always from static storage, and the newly built page is pushed only after it's done generating.
Example
functionBlog({posts}){return(<ul>{posts.map((post)=>(<li>{post.title}</li>
))}</ul>
)}// This function gets called at build time on server-side.// It may be called again, on a serverless function, if// revalidation is enabled and a new request comes inexportasyncfunctiongetStaticProps(){constres=awaitfetch('https://.../posts')constposts=awaitres.json()return{props:{posts,},// Next.js will attempt to re-generate the page:// - When a request comes in// - At most once every secondrevalidate:1,// In seconds}}exportdefaultBlog
Nice article. You could also say a word about using
getStaticProps
with Incremental Static Regeneration which allows you to use both statically generated content with dynamic updates when needed.Here's what Next.JS documentation says about it:
Inspired by stale-while-revalidate, background regeneration ensures traffic is served uninterruptedly, always from static storage, and the newly built page is pushed only after it's done generating.
Example
Thanks for adding this! I’ve used it before and it’s pretty slick.