perf: SSR homepage and load fonts progressively #3

Merged
waylon merged 5 commits from perf/homepage-ssr-progressive-fonts into main 2026-10-13 20:14:53 -05:00
Owner

Summary

  • Server-render the newest ready public video on /, including its poster and useful no-JavaScript content. Hydration adopts that card and continues with the cursor feed without duplication.
  • Keep desktop WOFF2 subsets and use baseline mobile font behavior with mobile-only Monocraft preload. This avoids the late font/style work that caused the earlier mobile TBT regression while retaining desktop font savings.
  • Preserve existing player, pagination, permalinks, no-JavaScript /watch, cache/ETag/gzip behavior, and full FFmpeg caption fonts.
  • Keep the concise report and screenshots; remove the large retained raw Lighthouse traces and JSON reports.

Measured results

Three cold Lighthouse 12.8.2 / Chromium 153 runs per case, matched 10-video fixture and simulated mobile network/CPU settings (412×823, 150 ms RTT, 1,638.4 Kbps, 4× CPU). Baseline 972b797; selected candidate includes CSS feed-progressive-9 and JS feed-progressive-6.

Mobile median Baseline Candidate
Performance 89 88
FCP 1.565 s 1.218 s
LCP 2.398 s 2.417 s
CLS 0.01844 0.00093
TBT 363 ms (80–477) 427 ms (335–515)
Font transfer 59,878 B / 2 fonts 59,878 B / 2 fonts

LCP is effectively at parity and CLS improves. FCP/TBT are noisy; candidate TBT median is 64 ms higher, so this PR does not claim a TBT improvement. In matched runs Style/Layout is similar and the major earlier regression traced to fonts has been removed. Desktop median LCP improves from 709 ms to 635 ms and font transfer drops from 244,261 B to 117,663 B (52%). See performance report for methods and caveats.

Current screenshots

Current mobile candidate

Current desktop candidate

Verification

  • just check: 59 tests passed; Ruff lint/format, ty, and FFmpeg render smoke all pass.
  • Chromium interactions with the 10-video feed: SSR hydration without duplicates; playback, pause, mute, scroll/pagination, and direct permalink/back navigation passed. The first active video and subsequent scrolled-to video play while inactive videos remain paused.
  • JavaScript-disabled homepage shows the SSR video, poster, title/author/source, and native controls.
  • Cache response check: public s-maxage=60, ETag, Vary: Accept-Encoding; gzip response returned content-encoding: gzip.
  • /create renders the existing guest-gated shell. Creator-only operations were not exercised without creator credentials.

CI and merge status

.forgejo/workflows/quality.yml is removed per request; this repository will use its documented local checks (just check, backed by locked uv dependencies). Historical Forgejo runs were red and their jobs endpoint returned 404, but no new Actions run is expected. The current local check passes. Mobile TBT remains noisy with a modestly higher median, which is documented as a tradeoff; LCP is near baseline and CLS improves.

## Summary - Server-render the newest ready public video on `/`, including its poster and useful no-JavaScript content. Hydration adopts that card and continues with the cursor feed without duplication. - Keep desktop WOFF2 subsets and use baseline mobile font behavior with mobile-only Monocraft preload. This avoids the late font/style work that caused the earlier mobile TBT regression while retaining desktop font savings. - Preserve existing player, pagination, permalinks, no-JavaScript `/watch`, cache/ETag/gzip behavior, and full FFmpeg caption fonts. - Keep the concise report and screenshots; remove the large retained raw Lighthouse traces and JSON reports. ## Measured results Three cold Lighthouse 12.8.2 / Chromium 153 runs per case, matched 10-video fixture and simulated mobile network/CPU settings (412×823, 150 ms RTT, 1,638.4 Kbps, 4× CPU). Baseline `972b797`; selected candidate includes CSS `feed-progressive-9` and JS `feed-progressive-6`. | Mobile median | Baseline | Candidate | |---|---:|---:| | Performance | 89 | 88 | | FCP | 1.565 s | 1.218 s | | LCP | 2.398 s | 2.417 s | | CLS | 0.01844 | 0.00093 | | TBT | 363 ms (80–477) | 427 ms (335–515) | | Font transfer | 59,878 B / 2 fonts | 59,878 B / 2 fonts | LCP is effectively at parity and CLS improves. FCP/TBT are noisy; candidate TBT median is 64 ms higher, so this PR does not claim a TBT improvement. In matched runs Style/Layout is similar and the major earlier regression traced to fonts has been removed. Desktop median LCP improves from 709 ms to 635 ms and font transfer drops from 244,261 B to 117,663 B (52%). See [performance report](https://git.waylonwalker.com/waylon/brainrot.waylonwalker.com/src/commit/0955366/performance-reports/2026-10-13/summary.md) for methods and caveats. ### Current screenshots ![Current mobile candidate](https://git.waylonwalker.com/waylon/brainrot.waylonwalker.com/raw/commit/0955366/performance-reports/2026-10-13/screenshots/candidate-mobile.png) ![Current desktop candidate](https://git.waylonwalker.com/waylon/brainrot.waylonwalker.com/raw/commit/0955366/performance-reports/2026-10-13/screenshots/candidate-desktop.png) ## Verification - `just check`: 59 tests passed; Ruff lint/format, ty, and FFmpeg render smoke all pass. - Chromium interactions with the 10-video feed: SSR hydration without duplicates; playback, pause, mute, scroll/pagination, and direct permalink/back navigation passed. The first active video and subsequent scrolled-to video play while inactive videos remain paused. - JavaScript-disabled homepage shows the SSR video, poster, title/author/source, and native controls. - Cache response check: public `s-maxage=60`, ETag, `Vary: Accept-Encoding`; gzip response returned `content-encoding: gzip`. - `/create` renders the existing guest-gated shell. Creator-only operations were not exercised without creator credentials. ## CI and merge status `.forgejo/workflows/quality.yml` is removed per request; this repository will use its documented local checks (`just check`, backed by locked `uv` dependencies). Historical Forgejo runs were red and their jobs endpoint returned 404, but no new Actions run is expected. The current local check passes. Mobile TBT remains noisy with a modestly higher median, which is documented as a tradeoff; LCP is near baseline and CLS improves.
fix: hide and wrap no-JS account hint
Some checks failed
quality / checks (push) Failing after 26s
quality / checks (pull_request) Failing after 41s
bdbbefa59f
perf: streamline homepage and font loading
Some checks failed
quality / checks (pull_request) Has been cancelled
quality / checks (push) Has been cancelled
45912f74ad
waylon force-pushed perf/homepage-ssr-progressive-fonts from 45912f74ad
Some checks failed
quality / checks (pull_request) Has been cancelled
quality / checks (push) Has been cancelled
to e5813cde78
Some checks failed
quality / checks (push) Failing after 42s
quality / checks (pull_request) Failing after 46s
2026-10-13 16:37:32 -05:00
Compare
docs: record controlled lighthouse investigation
Some checks failed
quality / checks (push) Failing after 48s
quality / checks (pull_request) Failing after 55s
8f9989bdf1
perf: stabilize mobile SSR font treatment
Some checks failed
quality / checks (push) Has been cancelled
quality / checks (pull_request) Has been cancelled
e6dc9030f7
docs: retain current Brainrot screenshots
Some checks failed
quality / checks (push) Failing after 48s
quality / checks (pull_request) Failing after 55s
09553663cb
waylon merged commit 60301dadbe into main 2026-10-13 20:14:53 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
waylon/brainrot.waylonwalker.com!3
No description provided.