#Also ISR with web hooks revalidateTag or
1 messages · Page 1 of 1 (latest)
adding @worldly gull
A little confused, the docs show that it has to be used with fetch but I'm using the Airtable JS SDK which doesn't expose that.
It says I can also use react's cache but not 100% clear on how to define a trigger to redeploy
react's cache is for fucntion deduping on a SINGLE request
if you want to cache in BETWEEN requests, persists cache in consequent request,
use
fetch() or unstable_cache()
those two, you can add revalidatePath/Tags mechanism
since your API doesn't use fetch() then you can use unstable_cache(). it has the same settings as fetch() only that it cache the result of a function instead of a URL fetch
taking a look and giving it a shot! thank u for the explanation
incrementalCache missing in unstable_cache
is this a bug?
hmmm maybe it can't be used in other platform?
im using it in windows, macs, and deployed to vercel and it works fine
it is after all... unstable
you can opt into build cache if data cache doesn't work
is there an alternative? im super confused
am i supposed to “revalidatePath” every time someone visits the website? and it will automatically redeploy if changes?
ISR in pages just redeployed whenever changes in web hook
Ure supposed to revalidatePath when you want to change the cached fetch of yout airtable api
Or revalidateTags
Then data cache are revalidated, the ISR route also regenerates
that's what I don't get or maybe i'm misunderstanding
Previously, it would automatically update with new data if the webhook was triggered. No depending on a user?
In this case, it will only revalidate if a user visits a certain path?
You can revalidate by accesing a certain api route to revalidate a tag
Next time user visit, cache is invalidated and it will fetch the data to ur airtable anew
all i had to do was
export const dynamic = 'force-dynamic';