Core Web Vitals in Production: LCP, INP and CLS
Operate web performance like a system: LCP, INP and CLS from field data, lab diagnosis, budgets, release-tagged RUM, regression gates and rollback.
Core Web Vitals: common questions
What are the Core Web Vitals?
Largest Contentful Paint (loading, good under 2.5 s), Interaction to Next Paint (responsiveness, good under 200 ms) and Cumulative Layout Shift (visual stability, good under 0.1), measured at the 75th percentile of real users.
What is the difference between field data and lab data?
Field data (RUM, CrUX) comes from real users on real devices and is what Google ranks on. Lab data (Lighthouse) is one controlled run, useful for finding the cause.
Related chapters
- The Cost of JavaScript: Bundle Size, Parsing and Hydration
- Critical Rendering Path Explained: DOM, CSSOM, Paint
- Critical CSS: Inline Above-the-Fold Styles
- CSS Performance: Selectors, @import and Layout Cost
- HTTP Caching Explained: Cache-Control, ETag, CDN
- Lazy Loading Images and Code: Best Practices
- List Virtualization (Windowing) in React Explained
- Intersection Observer API Explained, with Examples
- How Mobile Browsers Work: Camera, Permissions, Quirks
- Frontend Performance Case Studies: Netflix, Airbnb, Flipkart
Keep learning
Overview
Largest Contentful Paint When did the largest visible content finish painting? The hero image is hidden in client JavaScript and CSS, so the browser discovers it late. TTFB 620 delay 780 load 920 render 480 field p75 Break LCP into TTFB, resource-load delay, resource-load duration, and element-render delay. Here, discovery delay is the first suspicious slice. Expose the LCP resource in initial HTML, keep it out of lazy loading, and preload only when normal discovery cannot start it early enough. Repeat a production trace under the same conditions, then watch route + device p75 after rollout. Earlier bytes do not prove an earlier paint. Interaction to Next Paint How long did the page take to show the next frame after an interaction? A filter click lands behind background work, runs an expensive handler, then updates a very large DOM. input 86 handler 168 present 74 Split the slow interaction into input delay, processing duration, and presentation delay. Fix the largest contribution, not “React” in the abstract. Remove recurring main-thread work, reduce handler cost, yield non-urgent work, and window or simplify the DOM that must update. Reproduce the exact interaction with production code and realistic data. Confirm the interaction trace, then check field INP by route and device tier. Cumulative Layout Shift How much did visible content move unexpectedly during the page lifetime? An image arrives without reserved space, then a promotion is inserted above content and a late font changes wrapping. image .13 promo .08 font .04 Inspect shift clusters and the elements that moved. The thing that moved is not always the element that caused the shift. Reserve media and ad geometry, avoid inserting UI above existing content, and choose font fallbacks with compatible metrics. Test first and repeat visits, dynamic banners, responsive breakpoints, and the full session—not only the initial load. First-time catalog The site-wide median hides the exact population paying the startup cost. Use a production build, empty cache, representative mobile CPU/network settings, and the affected route—not the developer homepage. Record a trace and LCP attribution. Check TTFB, discovery time, priority, transfer, main-thread contention, and render delay separately. The same controlled run improves and the mobile first-visit p75 moves without harming image quality or later interactions. Long-lived workspace INP p75 rises after several minutes in a dense table, especially after repeated filtering and live updates. A fresh lab reload has a small DOM and misses accumulated subscriptions, rows, cache entries, and background work. Load a production fixture with realistic row count, keep the session alive, replay updates, then perform the named slow interaction. Capture the interaction and divide input delay, event processing, and presentation delay. Also inspect DOM size and memory growth. The filter paints inside the local guardrail throughout the session, with no lost keyboard behavior or stale results. Returning signed-in user CLS p75 regresses only when cached shell data, consent state, a promotion, and a late web font meet. The clean first-load test does not execute the returning-user UI sequence that moves the page. Seed the same storage and account state, preserve the cache condition, and test each supported viewport and font-loading outcome. Record layout-shift clusters and identify the unstable container, insertion point, or fallback-font mismatch that caused movement. Reserved geometry survives every state combination and the full-session field CLS returns inside its guardrail. Mobile commerce entry Useful product content and a primary action must win bandwidth and main-thread time on an ordinary phone. Authenticated workspace A larger shell is acceptable only when the long-lived interaction path stays responsive and later tools are split away. TV and media browse Key response, decoded media, memory, and the supported device floor matter more than a generic desktop score. Recommendations rail Support widget Experiment SDK All traffic All routes · mobile and desktop combined LCP p75 INP p75 CLS p75 Continue to the next cohort while watching the segmented dashboard. The aggregate view is a smoke alarm, not proof that every important journey is healthy. Android checkout Checkout · low-memory Android · India · release 7f31 Error rate TV browse Browse screen · low-tier TV · release 7f31 Key response p75 Memory high-water Crash-free sessions Core Web Vitals do not replace product-specific measures. Netflix’s device work is the useful model here: measure the interaction users actually perform. Chapter 7 · operating web performance A green audit is not a performance system Start with real-user pain, isolate the slow cohort, reproduce it in a controlled lab, fix the measured slice, prevent regressions, and roll out with a stop button.
1. Triage the user-visible symptom
Click a vital: a failing score becomes a breakdown, a targeted change, and a verification plan. Choose a Core Web Vital
2. Field data chooses the problem; the lab explains why
A median or a one-off laptop trace can both look healthy while an important user group is struggling. Choose a cohort and carry the context into the reproduction. Affected cohort First-time catalog Long-lived workspace Returning user Field · find where
Return to the cohort
Attach route, coarse device/network class, release ID, and privacy-safe context to the measurement. Field and lab evidence rules Compare production builds under repeatable conditions and record those conditions with the result. Treat profiler attribution as evidence about a trace, then validate the causal change with a controlled rerun. Do not call a development trace, one Lighthouse run, or “react-dom was busy” the production root cause. Initial JavaScript KB gzip Above-fold images Longest startup task Third-party script
3. Turn “fast” into an enforceable budget
These values are editable design-exercise starting points, not universal limits. A real team calibrates them from its users, product task, current baseline, and target device. Product path Commerce entry TV / media Proposed addition Support widget Experiment SDK Starting hypothesis
4. Connect the release to the regression
Click a segment: aggregate health can stay green while one route, device tier, or region gets slower. RUM segment All traffic Android checkout TV browse A staged performance rollout with an automatic stop decision 5% cohort release-tagged RUM compare guardrail halt + rollback
{release.cohort}
Slow mobile hardware, constrained networks, and a JavaScript-heavy monolith. Smaller entry and route chunks, image work, virtualization, service-worker caching, and explicit shell invalidation. Treat JavaScript, media, repeat visits, and cache correctness as one loading system. A dashboard accumulated expensive work on its initial, frequently executed paths. Profile hot paths, remove repeated work, load optional code later, and confirm changes with real-user analytics. Optimize the path users execute, not the component that merely looks sophisticated. The same TV UI runs on low-memory, low-CPU devices with non-browser rendering constraints. Measure key response, startup, frames, and memory on real target devices before applying platform-specific optimizations. Core Web Vitals need product and device metrics beside them. A brownfield application needed fast entries and fluid navigation without one giant bundle. Server-render the route, split code by route, fetch later work intentionally, and keep server/client configuration aligned. Myntra / Flipkart Commerce had to remain useful on low-end devices, weak networks, older browsers, and repeat visits. Control bundle growth, progressively enhance, cache the reusable shell, and keep critical commerce truth online. Google / web.dev One lab run cannot represent real loading, interaction, and layout stability across the user base. Use p75 field signals, segment mobile and desktop, then diagnose metric subparts in controlled traces.
5. What the industry stories actually teach
Copy the pressure → measurement → mechanism → guardrail loop. Do not copy an old framework choice or historical byte count without re-measuring your product.
{item.company}
Name the user task and supported device/network floor. Product metric + LCP/INP/CLS or device-specific signal Instrument route, coarse cohort, release ID, metric attribution, and errors. Privacy-safe p75 dashboard with sample count Reproduce a production build with the field cohort’s conditions. Trace, waterfall, interaction, layout-shift, or memory evidence Optimize the largest measured slice and state the trade-off. Small hypothesis with before/after evidence Enforce resource, task, image, and third-party budgets in review/CI. Named owner and an exception with expiry Guardrail, kill switch, and known-good version
6. The production performance review
Review question Evidence to leave Interview sentence: “I’ll define the user task and device floor, use field p75 to find the affected cohort, reproduce that path in a production lab build, optimize the largest measured slice, enforce a budget, then canary with release-tagged RUM and rollback.” Google: Web Vitals Current metrics, thresholds, and p75 field assessment Google: Optimize LCP TTFB, discovery delay, load duration, and render delay Google: Optimize INP Input delay, processing duration, and presentation delay Google: Performance budgets Resource and user-centric budgets as release constraints Pinterest PWA case study Lean JavaScript, route chunks, images, virtualization, and caching Vercel dashboard performance Hot paths, repeated work, deferred code, and field analytics Netflix TV UI Real-device key response, startup, frames, and memory Airbnb frontend rearchitecture Server entry, route bundles, and brownfield migration Myntra Zero Mobile bundle discipline and resilient delivery Flipkart Lite Progressive web commerce on constrained networks
More courses
- Jobs, linked to lessons — Browse jobs where every requirement links to the chapter that teaches it. See how ready you are, how long the gap takes to close, and which listings look stale.
- Match a job post to courses — Paste a job post. Each skill is matched to a track here and put in learning order, foundations first.
- React patterns from open source — Patterns extracted from Material UI, Radix, React Aria, React Hook Form, Redux Toolkit, TanStack, and Next.js — not slides about hooks.
- Databases in depth — How a query becomes work. Indexes, isolation, locks, and the plans that explain why a page is slow — not an ORM tour.
- System Design — Core concepts first (SQL vs NoSQL, CAP, indexing, replication, sharding), then designs grouped by what carries them: the database, Redis, Kafka, or many services.
- NestJS: build a real API — One ticket-booking API, built in order: a plain Node server first, then NestJS modules, validation, a real database, and the features real clients lean on.
- Microservices — Microservice patterns one diagram at a time: how to split a monolith, how services talk, and how data stays consistent without distributed transactions.
- Kafka — A beginner-to-senior path through event logs, reliable delivery, production operations, and disaster recovery.
- AI engineering for software engineers — Eight free reads, in order, for software engineers moving into AI: when to build an agent, how to build one, how to test it, and how the model works underneath.
- TypeScript in depth — The type system as a design tool. Inference, narrowing, generics, and the errors that mean the model is wrong — not a catalog of utility types.
- CSS in depth — See the box, then the page. Visual chapters from the box model through Flexbox surprises, Grid, selectors, and units, then backgrounds, shapes, and visual effects, each with a playground.
- Accessibility — Foundations first (WCAG in plain words, semantic HTML, lists, alt text), then hands-on HTML labs, a full pass of WAI-ARIA 1.3, and a final fix-the-page challenge.
- Docker — What an image is, why layers cache, and how containers find each other on a network.
- Redis — Fifteen Redis patterns, one picture each: cache, session, lock, counter, rate limiter, queue, and when Redis is the wrong tool.
- Kubernetes — Kubernetes from zero to operators: why it exists, Pods, Deployments and Services, then configuration, networking, storage, scheduling, scaling and security.
- AWS — AWS networking in plain English. A VPC is a gated housing society: streets are subnets, the Internet Gateway is the main gate, and a route table is the signboard.
- Networking: the NetRoute game — NetRoute is a packet logistics game. You wire up computers, switches, routers, firewalls and gateways, set each device, and watch glowing packets travel. If a packet gets dropped, the game shows you which header field was wrong.