Invalidate ImageResponse in dynamic api route handler with edge runtime
Unanswered
pjeweb posted this in #help-forum
pjewebOP
Is there a way to invalidate the edge cache for a
I generate images with a route handler at
ImageResponse for a dynamic api route handler?I generate images with a route handler at
/app/api/og/[eventId]. I want to cache it on the edge cache using Cache-Control: public, max-age=60, s-maxage=31536000 but also want the cache invalidated as soon as i change the event info. That happens in a "normal" serverless handler (using trpc/pages router). revalidatePath/revalidateTag does not help in that case. Is there any other API i could try?1 Reply
pjewebOP
I guess i could add a edge middleware in front that fetches the image with tags and then use
revalidateTag but that seems very complicated for such a simple task?