Skip to content

fix(seo): split sitemap into index + chunked children#35

Merged
oratis merged 1 commit into
mainfrom
claude/sitemap-split
Jun 27, 2026
Merged

fix(seo): split sitemap into index + chunked children#35
oratis merged 1 commit into
mainfrom
claude/sitemap-split

Conversation

@oratis

@oratis oratis commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Follow-up to #34. The interim ISR fix made the sitemap fast but, since the Docker build has no DB and the Cloud Run service scales to zero, cold instances served only the ~29 static URLs — the ~6.7k agent/skill pages were missing from the sitemap.

Fix

Use Next's generateSitemaps() to split, staying force-dynamic so the catalog is always complete:

  • /sitemap.xml → small, instant index (generated in production builds).
  • /sitemap/{id}.xml children → id 0 = static/blog/scenario pages; the rest are APPROVED agents then skills, 1,000 URLs/file. Each child is small and fast, so Google fetches them independently without the ~13s/12MB monolith timeout.

Notes / verification

  • Next passes id as Promise<string> — must Number(await id); a plain === number check silently falls through (caught locally — it was hitting prisma on the wrong branch).
  • Verified on a local dev server: /sitemap/0.xml → 200, valid XML, 29 page URLs with 15-locale hreflang intact.
  • The /sitemap.xml index is a production-only artifact (dev serves only children), so it's verified post-deploy.

🤖 Generated with Claude Code

The interim ISR fix (#34) made the sitemap fast but, because the Docker
build has no DB, served only the ~29 static URLs on cold instances (the
service scales to zero) — the ~6.7k agent/skill pages were missing.

Switch to Next's generateSitemaps() splitting, staying force-dynamic so
the catalog is always complete:
- /sitemap.xml becomes a small, instant index (production)
- /sitemap/{id}.xml children: id 0 = static/blog/scenario pages; the rest
  are APPROVED agents then skills, 1000 URLs per file. Each child is small
  and fast, so Google fetches them independently without timing out.

Note: Next passes `id` as Promise<string>; await + Number() it (a plain
=== number comparison silently falls through). Verified id=0 renders the
page routes (200, valid XML, hreflang intact) on a local dev server.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@oratis oratis merged commit b4789bc into main Jun 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant