Core Web Vitals for SPAs and JavaScript-Heavy Sites: The Complete 2026 Guide

Single-page applications (SPAs) and JavaScript-heavy sites face unique Core Web Vitals challenges. The client-side rendering model introduces performance...

Dilshad Akhtar
Dilshad Akhtar
Published: 18 June 2026
4 min read
TL;DRAI summary
  • SPAs render content in the browser using JavaScript.
  • The SPA rendering model works against good INP.
  • The SPA LCP problem starts with the initial HTML.
  • SPAs face CLS issues from dynamic content loading, route transitions, and state-driven UI changes.
  • Minimize JavaScript bundle size.
  • Run PageSpeed Insights on your SPA pages in mobile mode.

Single-page applications (SPAs) and JavaScript-heavy sites face unique Core Web Vitals challenges. The client-side rendering model introduces performance bottlenecks that traditional server-rendered pages do not have. INP is the most affected metric. LCP and CLS also suffer from...

Why SPAs Struggle with CWV

Illustration for: Why SPAs Struggle with CWV

SPAs render content in the browser using JavaScript. The initial HTML response is minimal. JavaScript must download, parse, and execute before any meaningful content appears. This delays LCP significantly. The HTTP Archive 2025 Web Almanac reports that pages using client-side rendering have median LCP 40% slower than server-rendered pages.

Interactivity is the biggest challenge. SPAs often load a large JavaScript bundle that handles routing, state management, and component rendering. Every user interaction triggers component re-renders that can block the main thread. This directly increases INP. Data from CrUX shows that SPA-heavy origins have median INP 35% worse than traditional sites.

Layout shifts are common on SPAs. Dynamic content loading, lazy-loaded components, and client-side routing all cause content to appear at unpredictable times. Without proper space reservation, these shifts accumulate into poor CLS scores.

SPA Architecture and INP

Illustration for: SPA Architecture and INP

The SPA rendering model works against good INP. When a user clicks a button or link, the application must execute JavaScript to update the view. This happens on the main thread. If the main thread is busy with other work, the interaction is delayed.

Framework architecture matters. React re-renders the entire component tree on state changes by default. Angular triggers change detection across the whole application. Vue has optimized reactivity but still requires careful component design. Each re-render cycle blocks the main thread.

A 2025 analysis of top React sites found that interaction handlers triggered re-renders of an average of 2,400 DOM nodes per interaction. Reducing this to under 500 nodes improved INP by 100 milliseconds on average.

LCP Optimization for SPAs

Illustration for: LCP Optimization for SPAs

The SPA LCP problem starts with the initial HTML. The page shell is often empty or near-empty. The LCP element is added by JavaScript after the bundle loads. This means the LCP timing includes the entire JavaScript pipeline.

Server-side rendering (SSR) is the most effective fix. Render the LCP element on the server and send it in the initial HTML. The user sees content before JavaScript executes. Next.js, Nuxt, and Angular Universal all support SSR.

If SSR is not feasible, use static generation for critical pages. Pre-render the HTML at build time. This eliminates the JavaScript rendering delay for LCP. Hydration can happen afterward without blocking the content.

Streaming server-side rendering is an advanced technique from 2025. The server sends HTML in chunks. The browser renders the LCP element from the first chunk while waiting for the rest. This can bring LCP under 1.5 seconds for SPA-like experiences.

CLS Optimization for SPAs

SPAs face CLS issues from dynamic content loading, route transitions, and state-driven UI changes. Each component mount and data fetch can cause layout shifts.

Reserve space for all dynamic content. Set explicit dimensions on component containers. Use skeleton screens with fixed dimensions instead of blank containers. This prevents shifts when content loads.

Avoid layout changes during route transitions. Use shared layout patterns that keep the page structure stable. Do not inject banners, modals, or notifications that push content down after the user has started interacting.

Practical Strategies for 2026

Minimize JavaScript bundle size. Audit your dependencies and remove unused code. Use dynamic imports for route-level code splitting. The goal is to ship less than 100KB of critical JavaScript for the initial load.

Break up long tasks. Any interaction handler that runs for more than 50 milliseconds must be optimized. Use setTimeout to defer non-essential work. Consider using web workers for computationally expensive operations.

Use the scheduling API (scheduler.yield) available in modern browsers. This allows interaction handlers to voluntarily yield control back to the browser, improving responsiveness. Chrome 124+ supports this API.

Measure INP with the Event Timing API in production. Collect real user interaction data to find the worst-performing handlers. Prioritize fixes based on the 75th percentile INP across your user base.

Audit Your SPA CWV

Run PageSpeed Insights on your SPA pages in mobile mode. Check LCP timing and identify which element is the LCP candidate. Profile INP with Chrome DevTools Performance panel on CPU throttled to 4x slowdown. Measure CLS during real user navigation flows. Implement real user monitoring to capture field data.

Note the gap between your SPA and a comparable server-rendered page. The extra JavaScript cost is measurable. Work to minimize it. SSR or static generation for critical content is the highest impact change. Audit quarterly.

References

  • web.dev/performance-spas (https://web.dev/performance-spas)
  • web.dev/inp (https://web.dev/inp)
  • HTTP Archive JavaScript Report (https://httparchive.org/reports/loading-speed#javascript)
  • Chrome DevTools SPA Performance Guide (https://developer.chrome.com/docs/devtools/performance/reference)

Ready to Build Your Dream Website?

Let's discuss your project and create something amazing together.