All posts

6 min readPost 20

The landing page's first screen: mobile Lighthouse from 47 to 99

Embedding Obituary's real React desktop calendar straight into the homepage hero dropped mobile Lighthouse to 55 with a 5.2-second LCP. Here are the three targeted changes—HTML-first hero copy, per-locale splitting without entrance animation libraries, and hero-only hydration—that took mobile Lighthouse to 99–100 in three and a half hours.

On this page
  1. Step 1: stop hiding hero text behind JS—LCP dropped from 5.2 s to 1.0 s
  2. Step 2: cut bundle size and layout cost—score reached 80–85
  3. Step 3: hydrate only the first screen—score hit 99–100
  4. Four permanent guardrails in our web guide

Obituary's desktop window is an interactive calendar organizing tracked files by expiry date. To let first-time visitors test hovering, extending lifespans, and dragging cards straight on the homepage without installing anything, we embedded the real React GUI component directly into the hero on the night of 20 November.

The demo felt great—and tanked mobile performance. Under Lighthouse mobile throttling (slow 4G plus 4× CPU slowdown), the new hero scored 55 with a 5.2-second LCP (the previous version had already been sitting at 47–49).

Three and a half hours later, with the exact same live component under identical throttling, local builds hit 99 to 100.

MilestoneMobile Lighthouse
Before live component & 10 locales47–49
After live component & 10 locales55
Step 1: paint hero text directly with HTML74
Step 2: strip JS/layout work before first screen80–85
Step 3: hydrate only the first screen99–100

Step 1: stop hiding hero text behind JS—LCP dropped from 5.2 s to 1.0 s ​

A single trace exposed the biggest offender. Every above-the-fold text element—tagline, heading, subtitle, and both action buttons—sat inside JavaScript-driven entrance animations starting at opacity: 0. The browser received the HTML immediately, yet held back painting the largest text block until the full JS bundle downloaded, parsed, and animated. Lighthouse billed all of that script delay straight to LCP (5.2 s).

We removed JS animation wrappers from hero text so it renders directly from HTML, leaving only a pure-CSS opacity and transform entrance on the window card.

At the same time we killed a hidden CPU drain: ten script-driven SVG sparkles beside the title were repainting ten times a second forever. Replacing them with static elements driven by a CSS animation that pauses off-screen, in hidden tabs, or under reduced motion dropped 4×-throttled main-thread busy time across the first 6 seconds from 4.7 s to 2.7 s.

Step 1 alone cut LCP from 5.2 s to 1.0 s and jumped the mobile score from 55 to 74.

Step 2: cut bundle size and layout cost—score reached 80–85 ​

Next we pruned five expensive sources of pre-paint work:

  • Move animation libraries off the entry chunk: Flow and Story sections below the fold became lazy-loaded (still prerendered into static HTML so text works without JS); scroll reveals and rotating headline words switched to pure CSS transform and opacity.
  • Load only the active locale: splitting copy by language shrank the entry JS bundle from 744 kB to 292 kB, paired with modulepreload so copy arrives alongside the script.
  • Preload hero fonts: preloaded hero fonts prevented late reflow, while the embedded window demo set font-display: block to stop mid-load shifts.
  • Drop heavy compositing: replaced large blur-3xl glow layers with radial gradients, lazy-loaded below-the-fold images, and stopped requesting a 512 px icon on every visit.
  • Re-evaluating content-visibility: auto: we initially enabled it on lower sections here, then removed it later after testing showed estimated heights threw in-page anchor jumps off by up to 290 px while saving only ~7 ms of TBT.

Measured against the pre-ten-locale baseline, main-thread work fell by three-quarters:

MetricOld baselineAfter step 2
Mobile score47–4980–85
LCP5.5–5.8 s0.9 s
Total Blocking Time (TBT)3.1–6.8 s0.6–0.9 s
Main-thread work14–18 s~4.5 s
Desktop score71–8887–96

Step 3: hydrate only the first screen—score hit 99–100 ​

With LCP already down to 0.9 s, why was TBT still stuck at 600–900 ms? Hydration: React was eagerly hydrating every interactive section down the page before the visitor had even scrolled past the hero.

We split hydration cleanly at the fold:

  • Immediate hydration: only Nav and Hero hydrate on load.
  • Deferred below-the-fold: every section below the hero and the footer arrive as complete HTML from byte zero; their scripts load only on first scroll, touch, keypress, pointer movement, anchor click, or after 4.5 seconds. With JavaScript disabled, every section stays readable without flashing.
  • Zero mid-read font shift: switching page fonts to font-display: optional uses preloaded hero fonts when ready and leaves late fonts for the next visit instead of reflowing text mid-read, while reserving two lines for the mobile rotating tagline. Under slow network + slow CPU, CLS fell from 0.29 to 0.0004.
MetricBefore step 3After step 3
Mobile score76–8399–100
Total Blocking Time (TBT)0.7–1.2 s24–116 ms
Main-thread work4.4–5.5 s1.7–2.9 s
LCP0.9 s0.9 s
CLS0.290–0.004
Desktop score87–96100
Bar chart of mobile Lighthouse scores across each optimization step: 47–49 before, 55 after live demo and ten locales, 74 after HTML hero text, 80–85 after bundle/layout trimming, and 99–100 after hero-only hydration
Mobile Lighthouse progression across each commit under simulated slow 4G and 4x CPU throttling, climbing from 47–55 to 99–100.

Four permanent guardrails in our web guide ​

To stop future UI tweaks from quietly dragging mobile scores back down, we locked four rules into our site engineering guide:

  • Hero copy must be visible in raw HTML—never gated on opacity: 0 JS entrance animations.
  • Sections needing JS animation libraries lazy-load, and every page loads only its own locale copy.
  • Continuous animations stick to compositor-only transform/opacity, pause off-screen or in hidden tabs, and honor prefers-reduced-motion.
  • Any new hero visual gets a before-and-after Lighthouse check so LCP, TBT, and CLS cannot regress unnoticed.

Running mobile Lighthouse against the live deployed site confirmed the result: performance 100, LCP 1.3 s, TBT 70 ms, CLS 0.

Top of a live mobile Lighthouse report for the deployed homepage showing Performance 100, FCP 1.3 s, LCP 1.3 s, TBT 70 ms, CLS 0, and Speed Index 1.7 s
Live mobile Lighthouse report against the deployed site under default simulated throttling: score 100, LCP 1.3 s, TBT 70 ms, CLS 0.

All posts