The Diagnosis: Where the Seconds Were Leaking

When the founders of a B2B SaaS platform reached out, their analytics painted a grim picture: 44% of mobile signups were abandoning before the dashboard fully loaded. A Lighthouse audit revealed a punishing 4.2s Largest Contentful Paint (LCP) and 920ms Total Blocking Time (TBT).

Chrome DevTools performance profiling exposed three distinct bottlenecks: first, the client bundle was dragging in 800KB of unused icon sets and heavy utility libraries. Second, webfonts were blocking text render for nearly 900ms. Third, the backend API was executing 42 separate database queries in a sequential loop to populate customer metrics.

Surgical Interventions That Moved the Needle

Step 1 was tree-shaking the frontend bundle. We converted the dashboard to an islands architecture, ensuring static chrome renders immediately while only dynamic charts hydrate on the client. Bundle size dropped from 2.4MB to 68KB.

Step 2 was font and asset optimization. We self-hosted variable font subsets with unicode-range narrowing and applied `font-display: swap`. Hero visuals received explicit `fetchpriority="high"` and modern AVIF compression.

Step 3 was backend query batching. We indexed compound foreign keys in PostgreSQL and replaced the N+1 loop with a single grouped aggregation query wrapped in a 5-minute Redis cache with stale-while-revalidate invalidation.

The Production Results

LCP dropped from 4.2s to 640ms on mobile 4G networks. Total Blocking Time dropped from 920ms to 0ms. Within 30 days, the client observed a 26% lift in free-to-paid subscription conversions and reduced their AWS EC2 cluster size by half.