- Symptom
- x-vercel-cache: MISS on every request to a functionCache-Control: max-age=3600 reaches the browser but the function runs each times-maxage set by the function is missing from the response the browser sees
- Cause
- The Vercel CDN only stores function responses that carry s-maxage (or a CDN-Cache-Control or Vercel-CDN-Cache-Control header). Responses with set-cookie, private, no-store, or requests with an Authorization header are never cached, and Vercel strips s-maxage before the browser.
- Fix
- Return s-maxage with stale-while-revalidate, or a Vercel-CDN-Cache-Control header, and make sure the route sets no cookie.
- Apply
return Response.json(data, { headers: { 'Cache-Control': 'public, s-maxage=300, stale-while-revalidate=60' }, });- Affected
- Vercel CDN, all plans, as of October 2026
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders