#Also ISR with web hooks revalidateTag or

1 messages · Page 1 of 1 (latest)

lapis kite
#

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

worldly gull
#

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

lapis kite
#

taking a look and giving it a shot! thank u for the explanation

worldly gull
#

this is how i set up my on-demand revalidation

lapis kite
#

incrementalCache missing in unstable_cache

is this a bug?

worldly gull
#

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

lapis kite
#

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

worldly gull
#

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

lapis kite
#

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?

worldly gull
#

Next time user visit, cache is invalidated and it will fetch the data to ur airtable anew

lapis kite
#

all i had to do was
export const dynamic = 'force-dynamic';