简体   繁体   English

NextJS - ISR - 除非按需调用,否则如何永久验证

[英]NextJS - ISR - How to Validate Forever Unless On-Demand Called

NextJS has a revalidation option. NextJS 有一个重新验证选项。

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?可以做到这一点,还是 ISR 不是这项工作的最佳工具?

Thanks,谢谢,

J Ĵ

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.如果省略 revalidate,Next.js 将使用默认值 false(不重新验证)并且仅在调用 revalidate() 时按需重新验证页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM