I am trying to get on-demand revalidation working with next13 / the app directory. I know how to use the app-directory to recreate what previously required getServerSideProps or getStaticProps.
But there is one page on our site, that requires a rebuild (of that page) whenever a trigger / webhook is fired. I know I can do a
export const revalidate = XXXX;
```
...but it's not the same, I don't need to rebuild the site every `X` seconds.
Any ideas?
We need revalidation when we are working with nextjs static build, generated with the help of getStaticProps and getStaticPaths. All of our pages will be build as html files. We can also make our application as an hybrid model some pages will be statically generated and some are server side rendered.
For revalidation firstly you need to create a revalidation api in /pages/api directory.
With the the help of child process you can trigger a build that will re generate all pages with new data which is being fatched at build time.
Now to trigger a revalidation call this api, you can also add secret token to validate weather request is valid or not.