Vercel CDN Stops Caching Responses with Vary: Cookie
Key point
Responses with Vary: Cookie now return x-vercel-cache: MISS and vary_key_denied:cookie in logs.
Details
Vercel CDN no longer caches origin responses when the Vary header includes Cookie. This change addresses the inefficiency of creating numerous cache entries for visitor-specific values that are rarely reused. While the response is still served normally, it is not stored for future requests.
Identifying Uncached Responses
Developers can identify these responses by checking the x-vercel-cache header, which will be set to MISS. Additionally, Runtime Logs will display vary_key_denied:cookie as the cache reason.
Recommended Actions
If logs show vary_key_denied:cookie for a route expected to be cached, check the origin's Vary header:
- If the response is identical regardless of cookies, remove Cookie from Vary to allow caching.
- If the response depends on cookies, keep Cookie in Vary and use Cache-Control: private to prevent personalized responses from being stored in the shared CDN cache.
Caching behavior for other supported Vary headers remains unchanged.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.