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
Can you elaborate a bit more ?
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')
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