Skip to content

perf(api): cache sitemap pages#939

Merged
raymondjacobson merged 1 commit into
mainfrom
codex/cache-sitemap-pages
Jun 22, 2026
Merged

perf(api): cache sitemap pages#939
raymondjacobson merged 1 commit into
mainfrom
codex/cache-sitemap-pages

Conversation

@raymondjacobson

Copy link
Copy Markdown
Member

Summary

  • add a bounded per-server TTL cache for generated sitemap page XML
  • serve cached /sitemaps/:type/:fileName responses before running slug page queries
  • add handler coverage for cached sitemap page responses

Evidence

  • prod read-only pg_stat_statements showed sitemap slug page queries averaging roughly 12s per call, with count queries around 10s per call
  • /sitemaps/:type/index.xml already caches counts; crawler repeats can still hammer the expensive slug page queries, so this caches generated XML for 1 hour

Test Plan

  • go test ./api -run 'TestSitemap' -count=1\n- git diff --check

@raymondjacobson raymondjacobson force-pushed the codex/cache-sitemap-pages branch from ef62325 to 507bbb1 Compare June 22, 2026 17:52
@raymondjacobson raymondjacobson merged commit 0e8b571 into main Jun 22, 2026
5 checks passed
@raymondjacobson raymondjacobson deleted the codex/cache-sitemap-pages branch June 22, 2026 17:58
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