
Next.js on-demand static regeneration is finally here! ๐
This is a super cool feature that makes possible to refresh statically generate pages.
T...
For further actions, you may consider blocking this person and/or reporting abuse
Is there a way to revalidate multiple pages? Or all pages? Or would you just have to call
.unstable_revalidate()
multiple times with different paths?You can code api handler, let say
pages/system/revalidate
which can receive parameter likepageUrl
. Then in the next.config.js, you can have a rewrite rule like thisSo now, on any page, if you call
/hello/revalidate
, it will revalidate your hello page :). If you want to revalidate multiple pages, you can have another page which do a batch revalidate or just a bunch of curl scripts to do it.Great explanation of Next JS revalidation! We implemented this feature on video hug ai (our AI video SaaS) and it's been a game-changer for updating content dynamically. The on-demand revalidation saves us from unnecessary rebuilds while keeping content fresh.
for me, on Vercel, the revalidate works on all route expect the root '/'. It raises error 500. what should I do?
For me as well if I call it from the server side. But use it in a useEffect or client side context it won't fail.
Thanks for the detailed explanation of Next.jsrevalidation! We've implemented this feature in our project, and it's been incredibly useful for keeping our content up-to-date without unnecessary rebuilds. Appreciate you sharing this!
GREAT READ, FOR INTEGRATION VISIT : ajackus.com/hire-next-js-developer