Next.js Discord

Discord Forum

Edge Caching Issues

Unanswered
Savannah posted this in #help-forum
Open in Discord
SavannahOP
Hey everybody,

I am having trouble with the caching behaviour of API routes on Vercel. I am setting

Cache-Control: public, max-age=0, s-maxage=1, stale-while-revalidate=0


on my responses, but this does not seem to be handled in any way by the edge cache. For some routes, I constantly get X-Vercel-Cache: HIT even after waiting for minutes. With others, I only get X-Vercel-Cache: BYPASS.

The API routes I am talking about here are basic GET routes with no cookies, custom request headers, or anything else. Any idea what could cause this?

0 Replies