'how to on-demand revalidate all the pages at once

I'm trying to revalidate all the pages of my website on a certain event,

the problem that I'm running through is that I have to do it page by page :

...
try {
 await res.unstable_revalidate(
  `/`
 );
 await res.unstable_revalidate(
  `/about`
 ;
 await res.unstable_revalidate(
  `/shop`
 );
 ...
 return res.json({ revalidated: true });
} catch (err) {
   return res.status(500).send('Error revalidating');
  }

So my question is: Is there a way to on-demand ( using unstable_revalidate() ) revalidate all the pages of my website, Or do I have to do it page by page ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source