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

The front page's build shows its stretches in Server-Timing on a cache miss #16956

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

On a cache miss, GET / now sends front- phases in Server-Timing for the stretches of buildFrontPage. On a hit it sends none of them. frontPage in src/actions/front.ts now takes an optional lap callback (Lap) instead of a Request, so actions stay free of http.

Notes

opened this

On a cache miss, GET / now sends front-* phases in Server-Timing for the stretches of buildFrontPage. On a hit it sends none of them.

frontPage in src/actions/front.ts now takes an optional lap callback (Lap) instead of a Request, so actions stay free of http. src/web/studio/home.ts passes a callback that wraps timePhase.

Phases on a miss: each is sent once.

  • front-picks
  • front-records
  • front-repos
  • front-owners
  • front-reads
  • front-scores
  • front-looks
  • front-runs
  • front-rows
  • front-pulse

I added front-reads, front-scores, front-looks, front-runs and front-pulse beyond the five you named, so the time isn't left lumped in with the others. The existing key phase is unchanged.

Test: test/shelf-laps.test.ts uses two public apps and bumps front_epoch to force a miss. It asserts front-picks, front-records, front-repos, front-owners and front-rows appear exactly once, then that a second request sends no front-* phase.

Checks run: tsc is clean. shelf-laps and the front-related tests pass (33 tests in five files, four of them in shelf-laps). bun scripts/gate.ts passes apart from a note about comment lines over 100 columns in src/actions/front.ts, which it says the nightly rewrap handles.

Not done:

  • I didn't add a terminal side or a how-to, since a response header isn't a page, action or tool. The commit says "No door".
  • I didn't split entry() or rankFront further, so front-rows covers both.

To try: open / on the preview right after a change that bumps front_epoch, such as pinning an app. Server-Timing then lists the front-* phases. A reload within a minute lists none.

Closes #6273

commented

On a cache miss, GET / now sends front-* phases in Server-Timing for the stretches of buildFrontPage. On a hit it sends none of them.

frontPage in src/actions/front.ts now takes an optional lap callback (Lap) instead of a Request, so actions stay free of http. src/web/studio/home.ts passes a callback that wraps timePhase.

Phases on a miss: each is sent once.

  • front-picks
  • front-records
  • front-repos
  • front-owners
  • front-reads
  • front-scores
  • front-looks
  • front-runs
  • front-rows
  • front-pulse

I added front-reads, front-scores, front-looks, front-runs and front-pulse beyond the five you named, so the time isn't left lumped in with the others. The existing key phase is unchanged.

Test: test/shelf-laps.test.ts uses two public apps and bumps front_epoch to force a miss. It asserts front-picks, front-records, front-repos, front-owners and front-rows appear exactly once, then that a second request sends no front-* phase.

Checks run: tsc is clean. shelf-laps and the front-related tests pass (33 tests in five files, four of them in shelf-laps). bun scripts/gate.ts passes apart from a note about comment lines over 100 columns in src/actions/front.ts, which it says the nightly rewrap handles.

Not done:

  • I didn't add a terminal side or a how-to, since a response header isn't a page, action or tool. The commit says "No door".
  • I didn't split entry() or rankFront further, so front-rows covers both.

To try: open / on the preview right after a change that bumps front_epoch, such as pinning an app. Server-Timing then lists the front-* phases. A reload within a minute lists none.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs