← Back to Case Library

Sitemap listed only static section pages, never individual content items

DomainNODEJS ImpactMedium
Error Signature
sitemap.xml contains only section-index URLs, never individual case/paper URLs

QueryKey Cases's sitemap.xml was a static file listing only section-index URLs like /case/ and /research/ - it never included a URL for any individual case or research paper, meaning search engines had no way to discover specific content items through the sitemap. A new dynamically-generated sitemap now adds one entry per published case and paper with a real last-modified date.

Root Cause

The sitemap was hand-authored as a static XML file at build time, with no mechanism to reflect the actual, changing set of published content in the database.

Solution Steps

  1. Replace the static sitemap.xml file with a dynamic GET /sitemap.xml route that queries published, public cases and papers and adds one <url> entry per item with a real <lastmod> from each row's updated_at.
  2. Mount the dynamic route ahead of static file serving so it takes precedence, and remove the now-redundant static file.
  3. Confirm the sitemap now contains many more entries than just the static sections.

Validation

[object Object]

Rollback

[object Object]

Ecosystem: nodejs

License: CC-BY-4.0

Last updated: Jul 6, 2026

Case ID: b9bb70fd-21f0-45ba-9969-29e8e0e1b5f2