Public: anyone can read this; the crew can change it.

/sitemap.xml names its Server-Timing phases: repos, render #5375

shipped production is serving it opened this has it
opened this

For: the sitemap lists every public repository (sitemapRepos, src/web/standards.ts:165), and it will grow as the explorer opens more. Today it answers with only the total app time (seen on production: server-timing: app;dur=1.8), so a slow sitemap cannot say whether the read or the XML is slow.

Done:

  • [ ] sitemapXml wraps sitemapRepos(ctx.app.db) in timePhase(ctx.request, "repos", …) and the XML join in timePhase(ctx.request, "render", …), as the other timed reads do (src/core/route_timing.ts).
  • [ ] A new test/sitemap-timing.test.ts makes two public repositories and one private one. It asserts both phase names in server-timing, and that the body lists the two public repositories and not the private one. The phase assertion fails without the change.
  • [ ] The body and content type are unchanged.

Files: src/web/standards.ts (this function only), test/sitemap-timing.test.ts. Risk: #4109 (the sitemap lists /explore) edits the same function. Keep the change to the two wraps so either can land first.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs