- 200 with the XML (
Content-Type: application/xml; charset=utf-8) on success. - 502 with an empty body when the sitemap is unavailable (misconfigured env, unreachable endpoint). A sitemap must be real XML or an error — this is the one place the SDK surfaces failure instead of degrading silently.
Wiring it up
- Next.js App Router
- Next.js Pages Router
- Remix
- Hydrogen
app/sitemap.xml/route.ts
revalidate: 3600) by default. Note: this route handler sets only the content type — it does not set a Cache-Control header itself (Next/your CDN controls response caching).After deploying
- Verify
https://yourstore.com/sitemap.xmlreturns 200 with XML. - Submit it in Google Search Console (Indexing → Sitemaps) and reference it from
robots.txt:
robots.txt

