Skip to content
Bernhard GötzendorferAI automation that runs on its own · Vienna
FoundationDebugging & Solutions

Merged is not live: my sitemap stayed static on Vercel

My sitemap had ISR, yet Vercel served it as a static file. How a night of measurements found the cause, and what you can check on your own site.

TL;DR

My blog posts go live on their date without a deploy, through ISR. The sitemap had revalidate = 3600 for that, yet it stayed frozen at the last deploy. Vercel (Next.js 16.4) serves every route whose path ends in /sitemap.xml as a static file. A local vercel build does not show this. The sitemap now lives at /sitemap-index.xml, and /sitemap.xml is rewritten to it.

1 a.m. in Vienna, and the post is missing

Thursday, 5 November. A post is scheduled for that day: Why I'm building a second BuchhaltGenie. My posts appear at midnight UTC on their date, which is 1 a.m. in Vienna in winter. No deploy is needed for that. Pages, RSS and sitemap refresh once an hour through ISR.

That night I'm not taking it on trust. From 00:10 UTC a script requests three URLs every ten minutes: the sitemap, the RSS feed and /llms-full.txt, a plain-text manifest for AI crawlers. Among other things it lists every post. No deploy runs during that time.

At 00:20 UTC the post is in /llms-full.txt. At 01:00 UTC it is in the German RSS feed. In the sitemap it is missing in all 14 requests up to 02:21 UTC. Meanwhile the age header grows from 9432 to 17245 seconds. With revalidate = 3600 a fresh version should have arrived after an hour. It never does.

Why I measure at night in the first place

My website deploys from a GitHub mirror, and the mirror lags behind my GitLab. So a merge on GitLab doesn't mean it's live. Scheduled posts, on the other hand, need no deploy at all. The date in the frontmatter decides at the hourly rebuild whether a post is visible.

A post had already been due on 3 November. The next day at 13:15 UTC one of my AI-agent coding sessions measured it. The page returned 200, the post was in the RSS feed. It was missing from /sitemap.xml. The sitemap still reflected the deploy of 2 November. In the Vercel request logs it ran as pathType: static, while RSS and /llms-full.txt ran as prerender.

The obvious explanation was how the sitemap was built. It came from the metadata convention src/app/sitemap.ts, and next.config.ts set its own Cache-Control rule on /sitemap.xml. /llms-full.txt, by contrast, is a plain route handler with revalidate = 3600 and no Cache-Control of its own. And that one does use ISR in production.

So the first fix built the sitemap exactly the same way: a route handler at src/app/sitemap.xml/route.ts, output identical byte for byte, header rule removed. By the evening of 4 November it was live. The logs still said static.

Locally everything looked right

Next came a local vercel build --prod, on exactly the commit that was live. There the sitemap is a prerender with expiration: 3600, configured the same way as /llms-full.txt. No static file, no override.

That left two possibilities. Either static in the logs is only a label and everything works. Or Vercel does something in the real build that the local build does not. A second rewrite at that point would have targeted a cause the build didn't show. So the session wrote no code and waited for the night. The next due post would show what happens at runtime, with no deploy in between.

The night's verdict: a static file

You already know the numbers. The headers were more telling. The sitemap returned content-disposition: inline; filename="sitemap.xml", accept-ranges: bytes, an etag and a last-modified. The static /robots.txt returns the same pattern. /llms-full.txt returned none of it that night.

The session found the cause in the builder itself, in the @vercel/next package. It has a pattern called METADATA_STATIC_FILE_REGEX, and that pattern contains [\/]sitemap\.xml$. When the builder finds a source file for such a path, it replaces the prerender with a static file. Whether the file is called sitemap.ts or sitemap.xml/route.ts makes no difference. The path is what counts.

Why the build on Vercel does this and the local one does not, I have not measured. For the fix I did not need to know. It only needs a path the pattern does not match.

A different path, the same URL

The sitemap now lives at src/app/sitemap-index.xml/route.ts, still with revalidate = 3600. The public URL stays /sitemap.xml. That is how it appears in robots.txt, in Google Search Console and in /llms-full.txt. On the main site the proxy rewrites it:

// src/proxy.ts (simplified)
if (pathname === '/sitemap.xml') {
  return NextResponse.rewrite(new URL('/sitemap-index.xml', request.url));
}

Watch out: many matchers exclude paths that contain a dot. So /sitemap.xml has to be listed explicitly in the matcher, otherwise the request never reaches the proxy. In Next.js 16 the file is called proxy.ts and replaces middleware.ts.

This time the proof came before the merge. Because everything looked fine locally, it took a real build on Vercel: a preview deploy from a separate branch. In the preview's request logs /sitemap.xml goes through the route /sitemap-index.xml with pathType: prerender. As a control, /robots.txt stays static there. Production still showed static for /sitemap.xml at the same time.

To keep it from coming back, there is a test. It turns red as soon as a route of the main site matches the pattern again, whether as sitemap.ts or as sitemap.xml/route.ts. I've seen it fail once with each variant planted on purpose.

On 6 November, curl -I https://www.gotzendorfer.at/sitemap.xml on production shows x-matched-path: /sitemap-index.xml, and at age: 3627 it shows x-vercel-cache: STALE.

The headers fooled me at first

One thing I got wrong that night. I took the headers as the reliable sign of a static file. In the preview deploy, though, /llms-full.txt also returned accept-ranges and content-disposition: inline. On 6 November it does the same in production. So a prerendered route can carry these headers.

One difference still holds on 6 November: the static /robots.txt names a file in its content-disposition, the sitemap and /llms-full.txt do not. I would not rely on that. What settles it is the pathType field in the request logs.

What you can check

If your Next.js app runs on Vercel and your sitemap has revalidate, five checks help:

  • curl -I on your /sitemap.xml, several times over more than an hour. If age grows past your revalidate value without ever showing STALE, nothing is being rebuilt.
  • The Vercel request logs, filtered by path: vercel logs requests -e production -q 'requestPath:"/sitemap.xml"'. They must show pathType: prerender, not static.
  • To prove it, use a preview deploy, not a local vercel build. Locally, everything looked fine for me.
  • The content after a due date: is the new entry there without a deploy?
  • If the logs say static: move the route to a path that does not end in /sitemap.xml, and point /sitemap.xml at it with a rewrite.

My second domain agentic-cutter.com, served by the same Next.js app, also shows that it comes down to the path. Its sitemap lives internally at /agentic-cutter/sitemap.xml and, according to the request log, is served static as well. There is no scheduled content there, so I'm leaving it as it is for now.

A script that checks the live site

Since the end of October there has been a small read-only script for this. It reads the deploy commit from a health endpoint, then checks each due post's page, its sitemap entry and its RSS entry.

In How I Keep Thinking Critically When AI Agents Do the Work I describe the rule that a merged change is not yet live. Here it held even after the deploy.

Common questions

Why does a sitemap on Vercel not revalidate via ISR?

In my project (Next.js 16.4, November 2026), Vercel's Next.js builder served every route whose path ends in /sitemap.xml as a static file. That held for the sitemap.ts convention as well as for a route handler at sitemap.xml/route.ts. The sitemap then only changed with the next deploy, even with revalidate set.

How can I tell whether my sitemap is served as a static file?

The most reliable place is the Vercel request log: it shows pathType static or prerender. Another hint is an age header that grows past your revalidate value without ever showing STALE. Headers like accept-ranges alone are not enough, a prerendered route can carry them too.

Why does a local vercel build not show the problem?

Locally the sitemap was a prerender with expiration 3600, configured the same way as a route that does use ISR in production. Only the real build on Vercel served it as a static file. That is why the bug, and later the fix, could only be proven with a preview deploy.