Skip to content

perf(api): cache sitemap pages#939

Open
raymondjacobson wants to merge 1 commit into
mainfrom
codex/cache-sitemap-pages
Open

perf(api): cache sitemap pages#939
raymondjacobson wants to merge 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

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