revalidate a page on change to the content
Answered
Samyar posted this in #help-forum
SamyarOP
Hi
I want to know how can i revalidate a page on change to the content of the page.
for example a post, i dont want to revalidate it on a period of time i want it to get revalidated and updated when the content of the page changed
I want to know how can i revalidate a page on change to the content of the page.
for example a post, i dont want to revalidate it on a period of time i want it to get revalidated and updated when the content of the page changed
Answered by joulev
use on-demand revalidation https://nextjs.org/docs/app/building-your-application/data-fetching/revalidating#on-demand-revalidation
2 Replies
you can make your content part of useState() and make your page client version, and after that create useEffect hook with dependency of your content