Search code examples
cachingnext.jsincremental-static-regeneration

NextJS - ISR - How to Validate Forever Unless On-Demand Called


NextJS has a revalidation option.

revalidate: X

This is great for dynamically changing data for large sites with lots of visitors. But what if I don't change my data every minute, and don't want it to revalidate ever unless I manually call the on-demand revalidation through my app (like when a post gets updated).

I would like to cache my data unless the data gets manually updated in the database.

Can this be done, or is ISR not the best tool for the job?

Thanks,

J


Solution

  • If revalidate is omitted, Next.js will use the default value of false (no revalidation) and only revalidate the page on-demand when revalidate() is called.