Federated Sitemaps
ADR: Federated Sitemap Architecture Source:
omni-web-content-frontend/src/app/sitemap-index/,omni-web-gateway(sitemap assembly)
Overview
Section titled “Overview”The gateway owns /sitemap.xml and assembles it from two sources:
- Fallback sitemaps — SFCC child sitemaps (legacy, keyed by type)
- Zone sitemaps — Each MFE contributes its own sitemap for the pages it serves
When a zone registers its sitemap with replaces: ["key"], the matching SFCC fallback is automatically excluded.
How It Works
Section titled “How It Works”MFE Requirements
Section titled “MFE Requirements”If your MFE serves indexable pages (not behind login), you must:
- Serve sitemap XML at a route under your zone prefix
- Generate from source — query Sanity/catalog, don’t hardcode URLs
- Include
lastmodfrom the data source - Include alternates for multi-locale pages
- Register on PROD via the gateway sitemaps API with
replaceskeys - Cache with TTL (1 hour recommended)
MFEs behind login (e.g., account) don’t need sitemaps.
Implementation (Content Frontend)
Section titled “Implementation (Content Frontend)”Sitemap Index
Section titled “Sitemap Index”export const revalidate = 3600; // 1 hour
export async function GET() { const pages = await fetchSitemapPages(); const imageChunks = buildImageSitemapXmls(PUBLIC_URL, pages);
const sitemapUrls = [ `${PUBLIC_URL}/sitemaps/sitemap-pages`, ...imageChunks.map((_, i) => `${PUBLIC_URL}/sitemaps/sitemap-images-${i + 1}`), ];
const xml = buildIndexSitemapXml(sitemapUrls); return new NextResponse(xml, { headers: { 'Content-Type': 'application/xml' } });}Page Sitemap
Section titled “Page Sitemap”export const revalidate = 3600;
export async function GET() { const pages = await fetchSitemapPages(); // GROQ query for all published pages const xml = buildPageSitemapXml(PUBLIC_URL, pages); return new NextResponse(xml, { headers: { 'Content-Type': 'application/xml' } });}Data Source (GROQ)
Section titled “Data Source (GROQ)”*[_type in ["inspirationalBlog", "inspirationalCategory", "inspirationalLanding", "flexibleContentPage", "homePage"]] { "slug": slug, "country": country, "lastmod": _updatedAt,}Zone Replacement Keys
Section titled “Zone Replacement Keys”| Zone | Replaces Key | What It Takes Over |
|---|---|---|
content | folders | Inspiration, homepage, content pages |
pdp | products | Product detail pages |
customer-service | — | New pages (no SFCC equivalent) |
myaccount | — | Not indexable (behind login) |
Migration Sequence
Section titled “Migration Sequence”- Gateway takes over
/sitemap.xml— registers SFCC sitemaps as fallback - Content MFE goes live → registers with
replaces: ["folders"] - PDP MFE goes live → registers with
replaces: ["products"] - SFCC sunset → all fallback keys replaced, admin clears fallback list