Diagnostic step 1
Mark sensitive endpoints with Cache-Control: private or no-store to prevent edge caching of authenticated responses; use s-maxage only for truly public assets.
Generated Oct 3, 2026, 12:35:03 AM
Mark sensitive endpoints with Cache-Control: private or no-store to prevent edge caching of authenticated responses; use s-maxage only for truly public assets.
Send Vary: Cookie on responses that may legitimately vary by session so caches consider Cookie in the cache key (note: this can reduce cache efficiency and may still require CDN support).
Prefer serverless/regional functions for authenticated API logic that must always see full cookies rather than edge functions, or move session tokens to an Authorization header for stateless verification if feasible.
Instrument edge and origin with request/response header logs (without logging actual cookie values) to confirm whether Cookie is forwarded on cache-miss and whether cached responses are served without appropriate vary headers.
If uncertainty persists about Vercel edge behavior, open a support ticket with Vercel including request IDs and timestamps (do not share session cookie values) so they can inspect CDN cache key behavior. Consider adding a safeguard in the application to reject any cached response that lacks required authentication context rather than returning a 403 unexpectedly.