E.g following is my function is my API route on GET. How can I remove a user from unstable_cache with id of x on a delete route.
export const GET = async (request: Request, { params }: { params: { id: string } }) => {
const getUser = async (id: string) => {
// user get implementation
return user;
};
// get cached data
const cachedData = unstable_cache(async (id) => getUser(id), ['user', params.id], 60000);
const data = await cachedData(params.id);
return NextResponse.json(data);
}