Is it possible to discard the cache for a single vercel serverless function

Surely there is a way to discard the serverless function cache for a single function right?
3 Replies
Manupa Samarawickrama
Can you elaborate a bit more ?
jakeleventhal
jakeleventhal6mo ago
lets say i have a route /orders/get i want to cache this function execution, but manually discard the cache if something changes that would affect the returned value from this route like VercelAPI.invalidateCache('/orders/get')
Manupa Samarawickrama
Ah you are referring to route handler cache As a principle I would suggest keep your route handler be force-dynamic (Unless you want to use it to grab some quick json) Then use fetch cache control and in demand revalidation whan you actally call it
Want results from more Discord servers?
Add your server
More Posts