MigrationNew

    Vercel's CDN Stopped Caching Cookie-Varying Responses. A Five-Check Audit.

    On 30 September Vercel's CDN stopped storing any response whose Vary header includes Cookie. Nothing in your code changed, nothing failed, and no deploy marks the day. The only signals are a cache header and one reason string in your runtime logs.

    The change

    On 30 September 2026, Vercel's CDN stopped storing origin responses whose Vary header includes Cookie. The reasoning published in the changelog is plain: cookies carry visitor-specific values, so varying a cache entry by cookie produces a large number of entries that are almost never reused. Rather than fill the cache with single-use objects, the CDN now declines to store them at all.

    Nothing errors. Nothing in your repository changed. The affected responses still render and still return 200. They are simply rendered at the origin on every request, for every visitor, instead of being served from the edge.

    Vercel gives you two signals. The response carries x-vercel-cache: MISS, and Runtime Logs record the cache reason vary_key_denied:cookie.

    That is the whole problem with a change of this shape. There is no deploy to roll back, no failing test, no error in anyone's inbox. A route that used to be served from the edge is now served from your origin, and the only place that fact is written down is a header nobody is looking at.

    Why a migrated app is unusually exposed

    A Lovable app on Lovable hosting is a Vite single-page app. The CDN serves a static shell and the data arrives afterwards from Supabase. There is very little for a cookie to vary.

    The moment that app becomes a Next.js app on Vercel, which is the point of most migrations we run, server rendering enters the picture, and server rendering is where cookies get read. Session checks, consent banners, experiment assignment and analytics identifiers all touch the same header.

    Whether any of your routes actually send Vary: Cookie is not a question to reason about from first principles. It is a question you can answer in one command, and the answer is frequently not the one the team expects.

    What changed, by route shape

    What the route sendsBefore 30 SeptemberNowWhat to do
    No Vary: CookieCached at the edgeUnchanged, still cachedNothing
    Vary: Cookie, response identical for every visitorCached, keyed per cookie valueNot stored, origin render every requestRemove Cookie from Vary
    Vary: Cookie, response genuinely personalisedCached, keyed per cookie valueNot storedKeep Vary, add Cache-Control: private
    Vary: Cookie on a prerendered marketing pageCached, keyed per cookie valueNot storedFind what sets the cookie before touching headers

    The five checks

    1. Ask the route directly

    curl -sI https://yourdomain.com/ | grep -i -e vary -e x-vercel-cache

    Run it against your home page, your pricing page, your blog index, and one individual blog post. If the vary line does not mention Cookie, that route is unaffected and you can stop thinking about it. If it does, note the route and move to the next one. Four commands will usually tell you more than an afternoon of reading middleware.

    2. Confirm it in Runtime Logs

    Vercel records the cache reason vary_key_denied:cookie for every affected request. Filter Runtime Logs for that string over the last few days. The set of routes it returns is your actual blast radius rather than your estimate of it, and it will include routes nobody remembered were server-rendered.

    3. Decide per route, not globally

    Vercel's guidance splits two ways, and the split matters more than the fix.

    If the response is identical no matter what cookies the visitor sends, remove Cookie from the Vary header. The route becomes cacheable again and you are back where you were on 29 September.

    If the response genuinely depends on a cookie, keep Cookie in Vary and add Cache-Control: private. That tells the shared CDN not to store it, which is what you wanted in the first place.

    The temptation is to apply one of these sitewide. Resist it. The two cases have opposite failure modes, and a global rule guarantees you get one of them wrong.

    4. Read the usage metric under its new name

    On the same day, Vercel renamed the Edge Requests usage metric to CDN Requests. It is a naming change only, with pricing, limits and measurement unchanged, but if you are comparing this month against last month and looking for a line that no longer exists, that is why.

    Watch both numbers. A route that is no longer stored at the edge is rendered at your origin on every request, so the step change shows up in compute as well as in cache hit rate.

    5. Do not fix it by deleting the Vary header

    The fastest way to clear vary_key_denied:cookie out of your logs is to stop sending Vary: Cookie at all. On a route whose output really does depend on a session cookie, that is not a fix. That is how one visitor's page ends up in a cache that everybody shares.

    If a route is genuinely personalised, the correct outcome of this audit is that it stops being cached at the edge and you accept the origin render. Slower is not the same as wrong.

    Where this logic lives now

    One more thing landed on 30 September that is worth knowing before you start moving session handling around. Supabase released Supabase Middleware 1.0, an MIT-licensed engine for per-request logic on Web Fetch handlers, with support across Supabase Edge Functions, Vercel, Cloudflare Workers and other runtimes.

    If checks 3 and 5 send you looking for somewhere to put cookie-reading logic that is not scattered through your route handlers, that layer got a dedicated and portable home on the same day the caching rules changed. The timing is a coincidence. The relevance is not.

    The pattern this belongs to

    Fixed-price offers for AI-built apps compete on how quickly the first version ships. Two weeks, ten days, a weekend. That number is usually honest, and the build usually happens.

    What the offer tends not to say is what the fourth month looks like. In September alone, the platforms underneath a typical Lovable-to-Next.js app shipped a run of security releases, a Postgres minor release with actions required, metered logging, and this caching change. None of those arrive as a bug report against your code. They arrive as a default that moved while you were doing something else.

    Production-ready is a claim about the day of handoff. Staying production-ready is a different job, and it is the one nobody prices.

    Check yours

    If you would rather have the five checks above run against your deployment than described to you, that is the first twenty minutes of our Strategy Audit: $499, one-time, credited toward any build. IdeaFlo has completed 80 jobs on Upwork on Lovable, Supabase and Next.js.

    Book a Call

    Sources

    Related posts