The ability to revalidate on demand is really powerful. I'm curious what the rational for adding it to the response object as opposed to an import from Next.js.
When a GitHub issue is created or commented on, a webhook is fired which calls `unstable_revalidate()`, revalidates the page, and purges the cache globally in ~300ms.
On-demand ISR of any sort is a big win for me. It seems right now `unstable_revalidate` can only take a single string suggesting one path at a time. I would love for this feature to accept an array of strings – or better yet – maybe a regex so I can rebuild entire branches of a sitemap.
Either way I have been loving Next.js since starting to use it again in version 11 after trying a few other alternatives over the years.
6 comments
[ 3.4 ms ] story [ 20.1 ms ] threadWhen a GitHub issue is created or commented on, a webhook is fired which calls `unstable_revalidate()`, revalidates the page, and purges the cache globally in ~300ms.
I'll try the On-demand ISR right away, almost waited one year. I have just updated my Next.js to version 12.1: https://github.com/ixartz/Next-js-Boilerplate
I didn't get any issue with the update, it's already an excellent news!
Either way I have been loving Next.js since starting to use it again in version 11 after trying a few other alternatives over the years.