šŸ› Vercel shows diff content on diff domains with the same deployment

Q: to vercel infra team… are there different caches for different domains pointed to the same deployment?

We have seen many times now that our root prod domain doesn’t show content we expect in a deployment - even though the ā€œsourceā€ screen on deployment in the Web UI will show the expected content. Making a request to the same deployment through another domain, or the vercel.app domains will always show the content we expect.

I’ve tried pointing the root domain to Vercel with both A & CNAME records - doesn’t make a difference.

Often we trigger a new build which can solve the problem. But we’ve also tested that ā€œrollbackā€ to the known ā€œbadā€ deployment will show the bug again.

To me it seems that there’s a Vercel cache ā€œkeyedā€ to both the domainname and deployment. Meaning that the same deployment can show different content based on the domain (with no logic in the codebase to do this). This makes Vercel’s preview environments un trustworthy (as PROD could output different code).

I’d be happy to show Vercel staff how we can replicate this.

Also; is there a way to purge Vercel’s Edge Cache? I don’t see a way (it would make narrowing down this issue easier).

1 Like

It sounds like something is misconfigured in project settings or in the code. Is there any middleware or proxy set up for your site? Do the known ā€œbadā€ deployments work correctly if you clear browser cache? What happens if you purge everything from the data cache?

Thank you for the quick response and link to the detailed doc.

Answers:
I’ve tested with and without a proxy (issue still exists without the upstream proxy). There is middleware (but it’s only for a few dynamic redirects on routes that wouldn’t effect this issue). Browser Cache clearing does not change the issue. We’ve even done CURL commands and the raw HTML is missing content on domainA while the content appears in the HTML on domainB (both aliased to the same deployment with no logic in the code to change the HTML output of this Next.JS app - and rebuilding the same build (even with build cache) - will often fix the issue. AKA same code base, but different results between different deployments. We don’t use a vercel.json & we have no Cache-Control settings in the project.

Clearing Data cache doesn’t change anything. Is there a way to clear Vercel’s Static Files cache? Is there a way to clear the Vercel Edge Cache? (after deployment)

Based on Caching on Vercel's Edge Network am I to believe that domainA & domainB pointing (aliased) to the exact same deployment can have different caches? (our bug would seem to support this).

In that doc ā€œIt contains the following information:ā€ā€¦ what is ā€œITā€? Is ā€œitā€ the unique cache key? As that would contradict the sentence ā€œEvery deployment has a unique key used for caching based on the deployment URL created at build time.ā€ā€¦ as it’s not ONLY based on the deployment URL, it’s also based on up to 5 other factors.