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

/status answers under 6 KB and under 50 ms from a cache of at most 10 s #13352

Merged opened this

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

Merged

/status now weighs about 1.1 KB uncompressed (it was 10.4 KB), has no script, and is held for 10 s. I ran test/status-page.test.ts plus the landing-line, version, visitors and design-lint tests, tsc, gate.ts --fix and design-lint; all pass.

Notes

shipped production is serving it deploy 59903fa

opened this

/status now weighs about 1.1 KB uncompressed (it was 10.4 KB), has no script, and is held for 10 s. I ran test/status-page.test.ts plus the landing-line, version, visitors and design-lint tests, tsc, gate.ts --fix and design-lint; all pass. scripts/fast.ts said the diff was too broad to name tests, so I picked those by hand and did not run the whole suite.

What changed

  • src/web/pages/status.ts builds its own small document instead of using the shell, whose head, menus, palette and scripts alone weighed more than the 6 KB ceiling. The page is the one sentence, three rows and a footer with Status next to Privacy. It links the shared stylesheet and nothing else. Its CSP is default-src 'none'; style-src 'self'; img-src 'self' data:.
  • The markup is cached next to the 10 s words from statusWords, so a second request inside the window builds nothing. The responses also carry cache-control: public, max-age=10, for the HTML and for the JSON answer.
  • In src/web/layout.ts the shared footer listed Privacy twice. I removed the stray earlier link, so Status now sits next to Privacy in the footer that every other page uses.
  • New tests in test/status-page.test.ts check four things:

- The body is under 6144 bytes and contains no <script. - It has at most five rows. - It shows no internal host, path, error or secret text. - Two requests inside the hold produce one build.

Not done

  • I did not time the 50 ms bar against production or a preview. Locally the page's render phase took 0.6 ms, but the whole request still took about 35 ms in that run. The 0.35 s from the issue was not reproduced or measured on production.
  • The JSON answer is unchanged.
  • The page is no longer in the full shell, so it has no top bar, search or theme menu, and no theme flash guard (the inline boot style the shell adds). That is deliberate: it is how it fits the size ceiling.

The pre-push hook wanted a "Try:" line in a commit, so there is an empty commit saying how to try it: open /status signed out.

Closes #13348

2 earlier comments
commented

/status now weighs about 1.1 KB uncompressed (it was 10.4 KB), has no script, and is held for 10 s. I ran test/status-page.test.ts plus the landing-line, version, visitors and design-lint tests, tsc, gate.ts --fix and design-lint; all pass. scripts/fast.ts said the diff was too broad to name tests, so I picked those by hand and did not run the whole suite.

What changed

  • src/web/pages/status.ts builds its own small document instead of using the shell, whose head, menus, palette and scripts alone weighed more than the 6 KB ceiling. The page is the one sentence, three rows and a footer with Status next to Privacy. It links the shared stylesheet and nothing else. Its CSP is default-src 'none'; style-src 'self'; img-src 'self' data:.
  • The markup is cached next to the 10 s words from statusWords, so a second request inside the window builds nothing. The responses also carry cache-control: public, max-age=10, for the HTML and for the JSON answer.
  • In src/web/layout.ts the shared footer listed Privacy twice. I removed the stray earlier link, so Status now sits next to Privacy in the footer that every other page uses.
  • New tests in test/status-page.test.ts check four things:

- The body is under 6144 bytes and contains no <script. - It has at most five rows. - It shows no internal host, path, error or secret text. - Two requests inside the hold produce one build.

Not done

  • I did not time the 50 ms bar against production or a preview. Locally the page's render phase took 0.6 ms, but the whole request still took about 35 ms in that run. The 0.35 s from the issue was not reproduced or measured on production.
  • The JSON answer is unchanged.
  • The page is no longer in the full shell, so it has no top bar, search or theme menu, and no theme flash guard (the inline boot style the shell adds). That is deliberate: it is how it fits the size ceiling.

The pre-push hook wanted a "Try:" line in a commit, so there is an empty commit saying how to try it: open /status signed out.

commented

The gate now passes locally, and I've pushed the fix. The forge's check will rerun on it.

The check failed on two gate rules, both about commit-message lines, not code. I added an empty commit carrying:

  • No look: because /status isn't in app.looks, so no before/after pictures apply. It's a signed-out text page.
  • No door: because the terminal already shows the same status sentence. This pull only trims the page and drops its script.

I did not run tsc or the tests, since no code changed from the last push.

commented

Of the two failing tests, I fixed one and put the other down to a flake. I've pushed the fix.

  • Footer test: this pull moved the footer's Privacy link to sit after Status, so /security is no longer directly beside /privacy. The status test already requires Status then Privacy, so I loosened test/security-page.test.ts to expect Security somewhere before Privacy in the foot. The footer itself is unchanged. security-page and status-page pass, and tsc and the gate are clean.
  • Capacity test: test/capacity.test.ts passes when run alone (16 of 16), so I read the failure as a timing flake under shard load. I changed nothing for it.

I did not run the full suite here, since the forge runs it on the push. The commit carries No look: and No door: lines for the gate.

Approved

Preview at this head: /status is 200, about 1.1 KB, no script, one sentence and three rows, cache-control public max-age=10, server-timing app 23.6 ms. It reads and works with JavaScript off, and the footer puts Status beside Privacy. Two things I would do next: (1) build the headers through securityFloor in src/http/respond.ts instead of hand-writing CSP, nosniff and referrer-policy, so the floor stays one definition; (2) reuse the shared footer and a skip link instead of the hand-rolled footer, so the page does not drift from the shell it left.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs