ISR + Static Generation for dynamic routes based on the state of the data
Unanswered
Black carp posted this in #help-forum
Black carpOP
I have a site where content on the page may update every few days until it’s in its final state.
My question is if there is a way to make all the pages in their final state just static and only do ISR on the pages that aren’t in their final state.
Or do I just need to do ISR for this route. If so, is it possible to make the cache dynamic such that pages in their final state can have a long living cache while those not in their final state revalidate every few days?
My question is if there is a way to make all the pages in their final state just static and only do ISR on the pages that aren’t in their final state.
Or do I just need to do ISR for this route. If so, is it possible to make the cache dynamic such that pages in their final state can have a long living cache while those not in their final state revalidate every few days?
1 Reply
@Black carp I have a site where content on the page may update every few days until it’s in its final state.
My question is if there is a way to make all the pages in their final state just static and only do ISR on the pages that aren’t in their final state.
Or do I just need to do ISR for this route. If so, is it possible to make the cache dynamic such that pages in their final state can have a long living cache while those not in their final state revalidate every few days?
I think instead of time-based ISR you can do this:
* Tag the query in the page
* Call revalidateTag() in a route handler
* Call that route handler whenever the data changes – after the final state, the data no longer changes so the tag is no longer revalidated – the page is static forever.
* Tag the query in the page
* Call revalidateTag() in a route handler
* Call that route handler whenever the data changes – after the final state, the data no longer changes so the tag is no longer revalidated – the page is static forever.