Do on-demand revalidation approaches also include time based revalidation by default?
Answered
Milkfish posted this in #help-forum
MilkfishOP
👋 Hello! I'm looking at setting up some fetch requests to a CMS which would preferably remain cached indefinitely until we manually revalidate it (we've set up a route handler which our CMS hits when changes occur to ensure our pages remain up to date).
I was wondering whether any time based defaults are applied when you purely define a tag-based on-demand revalidation configuration (like the below):
I was wondering whether any time based defaults are applied when you purely define a tag-based on-demand revalidation configuration (like the below):
const response = await fetch(url, {
next: { tags: ['projects'] },
})4 Replies
@Milkfish 👋 Hello! I'm looking at setting up some fetch requests to a CMS which would preferably remain cached indefinitely until we manually revalidate it (we've set up a route handler which our CMS hits when changes occur to ensure our pages remain up to date).
I was wondering whether any time based defaults are applied when you purely define a tag-based on-demand revalidation configuration (like the below):
js
const response = await fetch(url, {
next: { tags: ['projects'] },
})
no, you have to set it if you need it
const response = await fetch(url, {
next: { tags: ['projects'], revalidate: 30 // 30 sec },
})MilkfishOP
Right okay, so by omitting the
revalidate object it is it cached indefinitely?@Milkfish Right okay, so by omitting the `revalidate` object it is it cached indefinitely?
yes until you revalidate it
Answer
MilkfishOP
ah sick, thanks!