Skip to content

ci(lighthouse): measure the bundle the way production serves it - #789

Merged
thinkclay merged 1 commit into
mainfrom
fix/787-lighthouse-measures-compressed
Sep 17, 2026
Merged

thinkclay merged 1 commit into
mainfrom
fix/787-lighthouse-measures-compressed

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

#787 was filed as "public pages intermittently never settle". They settle. The
~93s LCP was not a page bug, a timer, or a hanging request — it was an accurate
simulation of a bundle five times larger than the one production ships.

The report says so directly. On /privacy the long tasks do not start until
92,258 ms — the bundle is not slow to parse, it is slow to arrive — and
the settings are:

throttlingMethod  simulate
formFactor        mobile
downloadThroughput  1474.56 Kbps
cpuSlowdownMultiplier  4

entry-<hash>.js   transferSize 17.42 MB   (networkEnd 213ms in real time)

17.4 MB at 1474 Kbps is 97 seconds. LCP ~93s and TTI ~94s are that number,
capped by maxWaitForLoad: 90000. TTI was ~94s on every page and every run,
including the ones I had called clean — the LCP flake was only whether hydration
re-attributed the largest element after the bundle finally landed, which is why
it moved between pages and looked random.

Production does not send 17.4 MB:

expo serve         17.42 MB   ← what this job was measuring
production (gzip)   3.64 MB
production (br)     3.27 MB

expo serve applies no compression. apps/scaffald/server/index.js — which
already exists, is the documented Express/Dockerfile path in SSR-DEPLOY.md, and
whose deps all resolve — applies compression() and serves /_expo as
immutable, maxAge: '1y', which is what production does. So the job runs that
instead, and measures something a real visitor could experience.

This does not make the bundle acceptable. 3.27 MB brotli is still roughly 18
seconds to interactive on the same simulated connection, and compression does
nothing for the 2.2s of script evaluation or the ~1,700ms TBT, which are CPU.
It makes the measurement honest, which is the precondition for #774's box 5 —
budgets ratcheted from reality rather than from a harness artifact.

Refs #787, #774


🤖 Generated with Claude Code

#787 was filed as "public pages intermittently never settle". They settle. The
~93s LCP was not a page bug, a timer, or a hanging request — it was an accurate
simulation of a bundle five times larger than the one production ships.

The report says so directly. On /privacy the long tasks do not start until
**92,258 ms** — the bundle is not slow to parse, it is slow to *arrive* — and
the settings are:

    throttlingMethod  simulate
    formFactor        mobile
    downloadThroughput  1474.56 Kbps
    cpuSlowdownMultiplier  4

    entry-<hash>.js   transferSize 17.42 MB   (networkEnd 213ms in real time)

17.4 MB at 1474 Kbps is 97 seconds. LCP ~93s and TTI ~94s are that number,
capped by `maxWaitForLoad: 90000`. TTI was ~94s on **every page and every run**,
including the ones I had called clean — the LCP flake was only whether hydration
re-attributed the largest element after the bundle finally landed, which is why
it moved between pages and looked random.

Production does not send 17.4 MB:

    expo serve         17.42 MB   ← what this job was measuring
    production (gzip)   3.64 MB
    production (br)     3.27 MB

`expo serve` applies no compression. `apps/scaffald/server/index.js` — which
already exists, is the documented Express/Dockerfile path in SSR-DEPLOY.md, and
whose deps all resolve — applies `compression()` and serves `/_expo` as
`immutable, maxAge: '1y'`, which is what production does. So the job runs that
instead, and measures something a real visitor could experience.

This does not make the bundle acceptable. 3.27 MB brotli is still roughly 18
seconds to interactive on the same simulated connection, and compression does
nothing for the 2.2s of script evaluation or the ~1,700ms TBT, which are CPU.
It makes the measurement honest, which is the precondition for #774's box 5 —
budgets ratcheted from reality rather than from a harness artifact.

Refs #787, #774

Co-Authored-By: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the full nightly suites (Lighthouse, E2E) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant