Skip to content
SazM Fixed-price website fixes
Quick search
What needs fixing or building?

Type a symptom (e.g. 502, white screen, hacked, slow ttfb) or a service.

Use arrow keys to browse, Enter to select, and Escape to close.

20 matching options

Client Login Get a fix →

Performance Engineering · 8 min read

Core Web Vitals Remediation: Fixing LCP, INP & CLS at the Root

Diagnose and fix slow LCP, INP and CLS at the root in code and server caching instead of stacking WordPress or Shopify speed plugins.

Use field data to see whether visitors experience slow loading, delayed interactions or layout shifts. Evaluate each metric at the 75th percentile, separately for mobile and desktop. Web Vitals thresholds

A senior engineering approach treats Core Web Vitals as a systems measurement problem: diagnose the exact phase of the critical rendering path, eliminate root-cause bottlenecks in code and server delivery, and verify with lab and field metrics.

The Three Vital Pillars: Diagnostic Breakdown

1. Largest Contentful Paint (LCP) ≤ 2.5s

LCP measures the time from initial page load until the largest visual content element (typically a hero banner, product image, or main heading block) is completely rendered in the viewport.

LCP time breaks down into four sequential phases:

  • Time to First Byte (TTFB): Server processing, database query latency, and edge CDN routing.
  • Resource Load Delay: The elapsed time between TTFB and when the browser actually begins fetching the LCP resource.
  • Resource Load Duration: The time required to download the LCP asset over the wire.
  • Element Render Delay: The time between asset download completion and the paint event, often blocked by synchronous JavaScript execution or web font loading.

Root-Cause Remediation for LCP:

  • Direct Edge Preloading: Never let the browser discover your hero image through deeply nested CSS classes or client-side JavaScript hydration. Declare priority hints in the document <head>:
    <link
      rel="preload"
      as="image"
      href="/images/hero-mobile.webp"
      imagesrcset="/images/hero-mobile.webp 600w, /images/hero-desktop.webp 1200w"
      imagesizes="(max-width: 768px) 100vw, 1200px"
      fetchpriority="high"
    />
    
  • Modern Asset Encodings & Right-Sizing: Serve modern formats (AVIF or WebP) with proper responsive srcset definitions. An uncompressed 2MB PNG scaled down via CSS to 400px can delay LCP on 4G cellular links.
  • Edge Cache Invalidation & TTFB Reduction: Cache static HTML at the edge via Cloudflare Workers or Cache Rules with stale-while-revalidate headers. Exclude private and personalized responses.

2. Interaction to Next Paint (INP) ≤ 200ms

Replacing FID (First Input Delay), INP measures page responsiveness across the entire lifecycle of a user session—capturing the delay from clicks, taps, or key presses to the visual frame update on screen.

Poor INP can result from Long Tasks (tasks executing on the main thread for longer than 50ms) blocking user input handling.

Common INP Bottlenecks:

  • Third-party analytics and tracking scripts (Meta Pixel, TikTok, Hotjar, multiple tag managers) running un-debounced event listeners on window scroll, touch, or click.
  • Heavy React, Vue, or Next.js hydration passes recalculating entire component trees on mobile hardware.
  • Synchronous DOM mutations occurring within click event handlers (e.g., cart drawer toggles, filter accordions) instead of deferring heavy re-renders.

Root-Cause Remediation for INP:

  • Yielding to the Main Thread: Break massive JavaScript execution loops into discrete chunks using scheduler.yield() or a timer fallback:
    async function handleFilterUpdate(filterCriteria) {
      // 1. Immediately update critical UI state (spinner / button feedback)
      setLoadingState(true);
    
      // 2. Yield control back to browser to paint input feedback
      if ('scheduler' in window && 'yield' in window.scheduler) {
        await window.scheduler.yield();
      } else {
        await new Promise((resolve) => setTimeout(resolve, 0));
      }
    
      // 3. Execute heavier filtering / DOM recalculations
      applyCatalogFilters(filterCriteria);
      setLoadingState(false);
    }
    
  • Audit Third-Party Tag Ingestion: Move third-party tracking pixels to Web Workers via tools like Partytown or execute them via server-side edge webhooks (Cloudflare Workers / Zaraz) where compatible, then measure main-thread work again.
  • Debouncing Global Event Listeners: Ensure custom scroll, resize, or keyup handlers use passive: true listeners and requestAnimationFrame throttling.

3. Cumulative Layout Shift (CLS) ≤ 0.1

CLS measures visual stability: unexpected layout jumps that occur as elements shift while new resources load asynchronously.

Root-Cause Remediation for CLS:

  • Explicit Aspect Ratios on Media Elements: Always specify width and height attributes on <img>, <video>, and <iframe> elements, or define aspect-ratio in CSS so the browser reserves layout space before media arrives:
    .product-gallery-image {
      width: 100%;
      height: auto;
      aspect-ratio: 1 / 1;
    }
    
  • Reserve Space for Dynamic Embeds & Banners: Promotional banners, cookie consent bars, and dynamic price notices must render inside fixed-height placeholders rather than pushing existing content down by 80px upon arrival.
  • Font Display Strategy: Mitigate Flash of Unstyled Text (FOUT) and Flash of Invisible Text (FOIT) layout shifts by pairing font-display: swap with font metric overrides (size-adjust, ascent-override) matching system fallback fonts.

The Anti-Pattern: Plugin Stacking vs. Native Code

In platforms like Shopify and WooCommerce, store owners frequently install multiple caching, compression, and minification plugins hoping for a quick fix. In practice:

  • Plugins concatenate scripts into massive render-blocking bundles.
  • Speculative preloaders flood mobile cellular data connections with unnecessary requests.
  • App scripts fight each other for execution priority, spiking total blocking time (TBT).

The sustainable solution is native code remediation:

  1. Remove deprecated apps, theme fragments, and dead tracking pixels.
  2. Build custom sections in clean HTML/Liquid/TypeScript instead of heavy third-party page builders.
  3. Establish edge caching rules and proper HTTP cache-control semantics.

Measuring Your Baseline

Before changing code, establish an objective performance baseline using real lab data and field telemetry.

You can test any production URL instantly using the SazM Free Speed Audit to inspect edge TTFB, CDN caching headers, compression, and Lighthouse performance scores.

If your site fails Core Web Vitals, you can queue remediation tasks directly:

Shopify store showing a red Liquid error after removing an app? See Could not find asset snippets: the fix.

Seeing a React console error instead? Read the Next.js hydration failed fix.

If a slow server route is timing out on Vercel, read the Vercel FUNCTION_INVOCATION_TIMEOUT fix.

Frequently Asked Questions

What are the Core Web Vitals targets at the 75th percentile?

Largest Contentful Paint (LCP) should be 2.5 seconds or less, Interaction to Next Paint (INP) 200 milliseconds or less, and Cumulative Layout Shift (CLS) 0.1 or less, measured separately on mobile and desktop.

Why does stacking WordPress or Shopify speed plugins make Core Web Vitals worse?

Stacking optimization plugins often concatenates scripts into render-blocking bundles, triggers excessive preload requests on cellular links, and creates conflicting JavaScript execution that spikes blocking time.

How much does a Core Web Vitals speed fix cost with SazM?

SazM offers a fixed-price $199 speed optimization fix delivered within 48 hours (pay after staging verification), targeting root causes across server TTFB, caching, scripts and assets.

Engagement tracks · Fixed scope or monthly plan

Senior Engineering Without Agency Overhead

Track A · Fixed-price fixes (48h SLA)

Single Urgent or Speed Fix

Immediate code-level fixes with zero discovery calls. Emergency root-cause patch within 48 hours for $99, or full Core Web Vitals & speed remediation with before/after audit for $199. 100% money back if the agreed root cause cannot be fixed.

Running WordPress or WooCommerce? The WordPress care plan keeps your site updated, hardened, backed up daily, and monitored for $49/mo.

Track B · Ongoing capacity & builds

Monthly Plan or Custom Scope

Direct senior-level capacity embedded in your stack. Dedicated monthly engineering ($999/mo, 1 active task at a time, 24–48h PR delivery, pause or cancel anytime), or fixed-scope architectural milestones delivered within a 24h written quote.

✓ 20+ years engineering ✓ 100+ projects in the portfolio ✓ Fixes within 48 hours ✓ 100% money back if not fixed
1 Active Task at a Time
Requests are completed one by one in your priority order. As soon as an active task is shipped, tested, and approved, work starts immediately on your next task within our 24–48h SLA.
48h Emergency SLA
Clock starts as soon as site access details are provided. Delivered with full backup taken first, isolated staging testing, and 100% money back if not fixed.
WordPress Care Plan Scope
Weekly core and plugin updates pre-tested in staging, daily offsite encrypted backups, 24/7 uptime monitoring, and proactive security patching.
Pay Nothing Upfront
Zero upfront payment or credit card required. A 20-Year Senior Engineer diagnoses your issue, reproduces it on isolated staging, and deploys the fix. You only pay once you verify the staging reproduction or production fix.