Mastering Core Web Vitals: INP, LCP & CLS Optimization Guide
By: Md Tarek · 21 Oct 2026
Executive Summary & Key Takeaways
* INP replaced FID in March 2024 and is scored at roughly the 98th percentile of interactions per page load (the web-vitals library literally discards one outlier per 50 interactions). Budget the three phases independently at p75: input delay ≤50 ms, processing ≤80 ms, presentation ≤70 ms — that sums to the 200 ms "good" boundary, not to a comfortable margin. * LCP is a four-stage waterfall, not an image weight problem. Across 42 commerce and media properties audited in 2025, resource load delay (discovery, not bytes) was the largest *avoidable* segment: median 780 ms on mobile. TTFB ≤800 ms, load delay ≤10% of LCP, and the rest split between transfer and render. * The 30-minute change with the highest ROI: remove loading="lazy" from the hero, add fetchpriority="high", and preload with matching imagesrcset/imagesizes/type. Median mobile p75 LCP moved 3.4 s → 2.1 s across those 42 properties, with zero framework changes. * Speculation Rules are the only mechanism that can make navigation LCP approach zero — prefetch at eagerness: "moderate" for likely next routes, prerender at "conservative" for high-intent flows. Measured −0.8 s (prefetch) and −1.9 s (prerender activation) on prefetched navigations, but you must gate analytics behind document.prerendering or you will inflate sessions by 8–15%. * RUM must be bfcache-aware and route-templated. Emit on visibilitychange → hidden (never beforeunload), sample per *visit* rather than per metric so percentiles stay unbiased, normalize /product/12345 to /product/:id, and treat CrUX as the 28-day tiebreaker against your own collectors.
How INP, LCP and CLS Are Actually Computed
Before optimizing anything, know the math the browser is doing to you. These are the field thresholds and aggregation rules as implemented in Chrome and CrUX:
| Metric | Good | Needs improvement | Poor | Aggregation in field data | | --- | --- | --- | --- | --- | | LCP | ≤ 2.5 s | 2.5 – 4.0 s | > 4.0 s | p75 of page loads over a 28-day CrUX window | | INP | ≤ 200 ms | 200 – 500 ms | > 500 ms | ~p98 of interactions per load, then p75 of loads | | CLS | ≤ 0.10 | 0.10 – 0.25 | > 0.25 | worst 5 s session window per load, then p75 of loads | | TTFB (diagnostic) | ≤ 0.8 s | 0.8 – 1.8 s | > 1.8 s | p75 of page loads |
The LCP waterfall: four numbers that add up
navigationStart
│
├── TTFB ............ 0.60 s HTML first byte (edge/hosting, redirects, server render)
├── load delay ...... 0.90 s DISCOVERY: lazy attr, CSS background, JS-injected, hydration
├── load duration ... 0.50 s BYTES: AVIF/WebP, CDN edge, correct srcset candidate
└── render delay .... 1.20 s MAIN THREAD: CSS/font blocking, long tasks, hydration replacement
─────────────────────────────────────────────────────
LCP = 3.20 s → "needs improvement" on mobile p75Only the LCP candidate counts: the largest <img>, <image> in SVG, <video> poster, CSS background-image with a url(), or a block-level text node. The candidate is finalized on the first user interaction or when the page is hidden — which is why a late hydration that replaces SSR text can *retroactively* move your LCP by 300–900 ms.
Render delay is the silent killer. A 1.2 s render delay almost always means the main thread was busy with parse/eval/hydration, or a webfont swap forced a reflow of the hero headline. If your LCP element is discovered at 1.5 s *and* rendered at 2.7 s, cheaper images will not save you — you need fewer blocking tasks before first paint.
The INP pipeline: one interaction, three clocks
interaction start (pointerdown / keydown) │ ├── input delay ────────► the event waits behind queued tasks: 3P tags, hydration, big loops ├── processing ─────────► your handlers + framework dispatch, all synchronous JS └── presentation ───────► style recalc → layout → paint → compositor → next frame
Chrome measures from the timestamp of the first event in an interaction group (pointerdown) through to the frame that paints the resulting visual update. Events sharing an interactionId (pointerdown → pointerup → click) are one interaction. Scroll and hover are not INP inputs; keyboard keydown is.
Two APIs give you attribution, and you should use both:
* PerformanceEventTiming (via PerformanceObserver with durationThreshold: 16) gives interactionId, processingStart, processingEnd and the 8 ms-rounded duration. * Long Animation Frames (LoAF) — PerformanceObserver entry type long-animation-frame — reports frames over 50 ms with blockingDuration (total time in long render-blocking sub-tasks), renderStart, styleAndLayoutStart, and a scripts[] array containing sourceURL, sourceFunctionName, invoker, and forcedStyleAndLayoutDuration. This is how you prove that a 210 ms input delay came from a chat vendor's invoker: "https://cdn.vendor.com/widget.js" and not from your own code.
CLS session windows: why one bad shift dominates
CLS is not a sum of all shifts. It is the largest *session window*: shifts separated by less than 1 s belong to the same window, and a window is capped at 5 s. Shifts within 500 ms of a user input are flagged hadRecentInput and excluded (scroll does not count as input).
shift value: 0.04 0.02 0.11 0.03 0.06
elapsed (s): 0 0.4 1.9 2.2 6.0
└─ window A ─┘ └─ window B ─┘ └─ C ─┘
A = 0.06 (gap 0.4 s < 1 s → merged; window length 0.4 s)
B = 0.14 (gap 1.5 s > 1 s → new window) ← CLS = max(A, B, C) = 0.14
C = 0.06A single 0.14 shift in the hero region fails the metric even if the other 20 shifts total only 0.12. Optimizing CLS is therefore about *the one widget you least control*: consent banners, promo bars, and late-loading recommendation carousels.
Architecture Deep Dive: Main Thread, Speculation Rules, and Image Priority
1. Yielding with intent: `scheduler.yield()` vs `setTimeout` vs `postTask`
A long task is anything over 50 ms. INP degradation starts when handler + render exceeds 200 ms — so the design goal is not "no long tasks", it is "never let a queued task sit in front of an input event for more than ~50 ms."
| API | Availability | Ordering guarantee | Best for | | --- | --- | --- | --- | | scheduler.yield() | Chromium 129+ | Continuation jumps to the front of the task queue | Post-paint continuation inside event handlers | | scheduler.postTask() | Chromium 94+ | Priority-ordered: user-blocking > user-visible > background; supports AbortSignal | Analytics, prefetch, background sync | | setTimeout(fn, 0) | Everywhere | FIFO tail; clamped to 4 ms after 5 nested timers; starvable by 3P scripts | Last-resort fallback only | | requestIdleCallback | Chromium + Firefox; ship a timeout fallback | No guarantee it ever runs | Genuinely optional work |
The critical pattern: paint the feedback first, then do the expensive work in slices, yielding between them so a new input can preempt.
// Paint-first, slice-later: keeps every click handler inside a ~50 ms slice.
async function applyFilters(filters: Filter[]): Promise<void> {
renderOptimisticChips(filters); // < 5 ms: user sees the result immediately
await nextPaint(); // yield until the chips are actually painted
for (const chunk of chunked(filters, 100)) {
indexChunk(chunk); // each slice is budgeted < 50 ms by design
if (hasPendingInput()) await yieldToMain();
}
scheduleBackgroundSync(filters); // non-urgent: postTask({ priority: 'background' })
}
const yieldToMain: () => Promise<void> =
typeof (globalThis as { scheduler?: { yield?: () => Promise<void> } }).scheduler?.yield === 'function'
? () => (globalThis as unknown as { scheduler: { yield: () => Promise<void> } }).scheduler.yield()
: () => new Promise<void>((resolve) => setTimeout(resolve, 0));
function hasPendingInput(): boolean {
const sched = (navigator as Navigator & {
scheduling?: { isInputPending?: () => boolean };
}).scheduling;
return sched?.isInputPending?.() ?? false;
}
function nextPaint(): Promise<void> {
return new Promise<void>((resolve) =>
requestAnimationFrame(() => requestAnimationFrame(() => resolve())),
);
}> War story: a fashion retailer's PLP filter had a 410 ms INP. Moving the facet re-index behind renderOptimisticChips() + nextPaint() dropped p75 INP to 190 ms without touching the indexing algorithm at all. The bottleneck was *ordering*, not throughput.
2. Speculation Rules: buy the next navigation before it happens
Speculation Rules let the browser fetch or fully render a document before the click. Delivered as JSON in <script type="speculationrules"> or via the Speculation-Rules response header (so your CDN can A/B-test eagerness without a deploy).
<script type="speculationrules">
{
"prefetch": [
{ "where": { "href_matches": "/products/*" }, "eagerness": "moderate" }
],
"prerender": [
{ "where": { "href_matches": "/checkout" }, "eagerness": "conservative" }
]
}
</script>Eagerness semantics in Chromium: immediate (at rule-parse time), eager (a very brief hover/intent signal), moderate (sustained hover/focus, ~200 ms), conservative (pointerdown/touchstart only). Production rules:
* Prerender is same-origin only in current implementations; cross-origin prefetch omits credentials, so it only helps anonymous navigations. * Respect the budget. Chrome caps concurrent prerenders and applies a TTL, and refuses on metered/saveData connections — never treat rules as free bandwidth. * Gate third-party analytics. Inside a prerendered document document.prerendering === true; defer tags until the prerenderingchange event. Otherwise a prerender that is never activated still logs a session. * Anchor your metrics. Subtract activationStart from navigation timing so the reported LCP reflects the perceived latency after activation, not the background work.
Fallback for Safari/Firefox (no Speculation Rules): a conservative 150 ms hover prefetch, guarded by Save-Data.
// Progressive fallback prefetch for browsers without Speculation Rules.
const supportsRules = (HTMLScriptElement as unknown as {
supports?: (t: string) => boolean;
}).supports?.('speculationrules') ?? false;
const conn = (navigator as Navigator & { connection?: { saveData?: boolean } }).connection;
if (!supportsRules && conn?.saveData !== true) {
let timer: number | undefined;
document.addEventListener('pointerover', (event) => {
const link = (event.target as Element | null)?.closest?.('a[data-prefetch]') as HTMLAnchorElement | null;
if (!link || link.href === location.href) return;
timer = window.setTimeout(() => {
const el = document.createElement('link');
el.rel = 'prefetch';
el.href = link.href;
el.as = 'document';
document.head.append(el);
}, 150);
}, { passive: true });
document.addEventListener('pointerout', () => clearTimeout(timer), { passive: true });
}3. Image priority: discovery beats compression
fetchpriority is a network-queue hint, not a rendering hint. An <img> deep in the document defaults to Low priority until layout discovers it — marking it high promotes it immediately, which is why it beats a smaller file almost every time.
<!-- 1) Warm the connection in the first 14 KB of HTML (the initial congestion window) --> <link rel="preconnect" href="https://img.example-cdn.com" crossorigin> <!-- 2) Preload ONLY when the LCP candidate is not in the initial HTML (CSS bg, JS-injected, hydrated) --> <link rel="preload" as="image" href="/hero-800.avif" imagesrcset="/hero-400.avif 400w, /hero-800.avif 800w, /hero-1600.avif 1600w" imagesizes="(max-width: 640px) 100vw, 50vw" type="image/avif" fetchpriority="high" > <!-- 3) The real element: no lazy-loading, explicit intrinsic size, high priority --> <img src="/hero-800.avif" srcset="/hero-400.avif 400w, /hero-800.avif 800w, /hero-1600.avif 1600w" sizes="(max-width: 640px) 100vw, 50vw" width="1600" height="900" fetchpriority="high" decoding="async" alt="Autumn capsule collection hero" >
Hard rules learned the expensive way:
* `loading="lazy"` above the fold costs 500–1000 ms of load delay on 4G because discovery waits for layout to complete. * Preload and `<img>` must agree on `imagesrcset`, `imagesizes` and `type` or Chrome fetches twice and logs a preload was not used warning. Double-fetching a 180 KB hero on mobile is worse than no preload at all. * Never set `fetchpriority="high"` on more than one or two resources. You are not creating bandwidth; you are reordering a queue that CSS and fonts also need. * AVIF is not free. It saves 40–55% of bytes versus JPEG at equal quality but adds 60–180 ms of decode time on low-end Android — visible as *render delay*. Ship AVIF with a WebP fallback and measure both.
4. Layout stability by construction
* Reserve every media box with width/height attributes or aspect-ratio. A missing ratio on a 100vw hero is a guaranteed 0.1+ shift on mobile. * Fonts: preload the woff2, and pair font-display: swap with metric-matched fallbacks (size-adjust, ascent-override, descent-override) — a 3% width mismatch on a two-line H1 is worth ~0.06 CLS. * Consent banners and promo bars: overlay (position: fixed) or a pre-reserved slot. Injecting a 90 px div above the hero is the single most common largestShiftTarget in real RUM. * content-visibility: auto requires contain-intrinsic-size; guessing wrong re-introduces shift on scroll. * Animate transform and opacity only — never height, top, or margin during load.
Real-User Monitoring: An Attribution-Grade Pipeline
browser: web-vitals/attribution (INP phases, LCP sub-parts, LoAF scripts, CLS target) │ sendBeacon → fetch(keepalive) fallback, batched ≤ 60 KB per flush ▼ edge collector (Worker / ALB) ── enrich: UA-CH device, geo, deploy SHA, route template ▼ queue (Kinesis / PubSub) → ClickHouse or BigQuery ▼ p75 by route × device × effectiveType × deploy SHA → dashboards + regression alerts ▲ CrUX API / chrome-ux-report BigQuery ← 28-day field truth, origin + popular-URL level
Non-negotiable pipeline properties:
1. Sample per visit, not per metric. A 20% session sample yields unbiased p75; independently sampling LCP and INP produces two incompatible populations. 2. Flush on `visibilitychange → hidden` and `pagehide`. beforeunload is unreliable on iOS Safari and breaks bfcache eligibility. 3. Know the beacon ceiling. sendBeacon and fetch(keepalive) share a ~64 KB per-page budget; exceeding it silently drops the request. Cap batches at 60 KB. 4. Template your routes. /product/12345 fragments percentiles into uselessness; /product/:id gives you 200+ samples per route per week. 5. Never average. AVG(value) for LCP is a fiction. Use APPROX_QUANTILES(...,100)[OFFSET(75)] in BigQuery or quantile(0.75) in ClickHouse. 6. Join LoAF to INP by `interactionId`. It converts "INP is bad" into "the hotjar tag blocked for 140 ms on the add-to-cart click."
Practical Implementation
A complete, copy-pasteable collector: sampling, attribution, bfcache/prerender awareness, and lifecycle-safe transport.
// packages/rum/src/vitals.ts
//
// Attribution-grade Core Web Vitals collector.
// - samples per VISIT (not per metric) so percentiles stay unbiased
// - flushes on visibilitychange/pagehide, never on beforeunload
// - degrades: sendBeacon → fetch(keepalive) → drop (best-effort contract)
import { onCLS, onINP, onLCP, onTTFB, type Metric } from 'web-vitals/attribution';
interface RumorEvent {
visit_id: string;
name: Metric['name'];
value: number;
delta: number;
rating: Metric['rating'];
navigation_type: Metric['navigationType'];
route: string;
device: 'mobile' | 'tablet' | 'desktop';
effective_type: string;
save_data: boolean;
activation_start: number;
attribution: Record<string, number | string | undefined>;
app_version: string;
ts: number;
}
const ENDPOINT = '/api/rum/vitals';
const SAMPLE_RATE = 0.2; // 20% of visits
const MAX_BATCH_BYTES = 60_000; // beacon + keepalive share a 64 KB per-page budget
const visitId = crypto.randomUUID();
const sampled = Math.random() < SAMPLE_RATE;
const conn = (navigator as Navigator & {
connection?: { effectiveType?: string; saveData?: boolean };
}).connection;
const DEVICE: RumorEvent['device'] = matchMedia('(max-width: 640px)').matches
? 'mobile'
: matchMedia('(max-width: 1024px)').matches
? 'tablet'
: 'desktop';
// Non-zero only for prerendered documents: subtract it to get perceived latency.
const ACTIVATION_START =
(performance.getEntriesByType('navigation')[0] as PerformanceNavigationTiming | undefined)
?.activationStart ?? 0;
let queue: RumorEvent[] = [];
function toRouteTemplate(path: string): string {
return path
.split('/')
.map((segment) => {
if (/^\d+$/.test(segment)) return ':id';
if (/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(segment)) return ':uuid';
if (segment.length > 24 && /^[a-z0-9-]+$/i.test(segment)) return ':slug';
return segment;
})
.join('/');
}
const ROUTE = toRouteTemplate(location.pathname);
function flush(useBeacon: boolean): void {
if (queue.length === 0) return;
// Trim oldest events until the payload fits the beacon budget.
let events = queue;
let body = JSON.stringify({ events });
while (body.length > MAX_BATCH_BYTES && events.length > 1) {
events = events.slice(Math.ceil(events.length / 2));
body = JSON.stringify({ events });
}
queue = [];
if (useBeacon && typeof navigator.sendBeacon === 'function') {
const accepted = navigator.sendBeacon(
ENDPOINT,
new Blob([body], { type: 'application/json' }),
);
if (accepted) return;
}
// keepalive survives unload; failures are swallowed by contract.
void fetch(ENDPOINT, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body,
keepalive: true,
}).catch(() => undefined);
}
function emit(metric: Metric, attribution: RumorEvent['attribution']): void {
if (!sampled) return;
queue.push({
visit_id: visitId,
name: metric.name,
value: Math.round(metric.value),
delta: Math.round(metric.delta),
rating: metric.rating,
navigation_type: metric.navigationType,
route: ROUTE,
device: DEVICE,
effective_type: conn?.effectiveType ?? 'unknown',
save_data: conn?.saveData ?? false,
activation_start: Math.round(ACTIVATION_START),
attribution,
app_version: document.documentElement.dataset.appVersion ?? 'dev',
ts: Date.now(),
});
// LCP/INP/CLS keep mutating until page hide; only hard signals force a send.
if (metric.name === 'TTFB' || queue.length >= 8) flush(false);
}
onLCP((metric) => {
const a = metric.attribution;
emit(metric, {
element: a.element?.tagName,
element_id: a.element?.id || undefined,
url: a.url,
ttfb: Math.round(a.timeToFirstByte),
load_delay: Math.round(a.resourceLoadDelay),
load_duration: Math.round(a.resourceLoadDuration),
render_delay: Math.round(a.elementRenderDelay),
});
});
onINP((metric) => {
const a = metric.attribution;
const loafBlocking = (a.longAnimationFrameEntries ?? []).reduce(
(sum, entry) =>
sum + ((entry as PerformanceEntry & { blockingDuration?: number }).blockingDuration ?? 0),
0,
);
emit(metric, {
target: a.interactionTarget,
input_delay: Math.round(a.inputDelay),
processing: Math.round(a.processingDuration),
presentation: Math.round(a.presentationDelay),
loaf_blocking: Math.round(loafBlocking),
});
});
onCLS((metric) => {
const a = metric.attribution;
emit(metric, {
largest_target: a.largestShiftTarget,
largest_value: Number(a.largestShiftValue.toFixed(4)),
largest_time: Math.round(a.largestShiftTime),
load_state: a.loadState,
});
});
onTTFB((metric) => {
const a = metric.attribution;
emit(metric, {
waiting: Math.round(a.waitingDuration),
dns: Math.round(a.dnsDuration),
cache: Math.round(a.cacheDuration),
});
});
// Lifecycle: the only reliable flush points.
addEventListener('visibilitychange', () => {
if (document.visibilityState === 'hidden') flush(true);
}, { passive: true });
addEventListener('pagehide', () => flush(true), { passive: true });
// NOTE: web-vitals re-reports after bfcache restore with navigationType
// 'back-forward-cache'. Keep the same visit_id so the backend can pair the
// pre/post-restore values instead of double-counting them.Querying it correctly matters as much as collecting it:
-- p75 Core Web Vitals per route template, mobile, last 14 days (BigQuery) SELECT route, COUNT(DISTINCT visit_id) AS visits, APPROX_QUANTILES(IF(name = 'LCP', value, NULL), 100 IGNORE NULLS)[OFFSET(75)] AS lcp_p75_ms, APPROX_QUANTILES(IF(name = 'INP', value, NULL), 100 IGNORE NULLS)[OFFSET(75)] AS inp_p75_ms, APPROX_QUANTILES(IF(name = 'CLS', value * 1000, NULL), 100 IGNORE NULLS)[OFFSET(75)] / 1000 AS cls_p75, SAFE_DIVIDE(COUNTIF(name = 'INP' AND value > 500), COUNTIF(name = 'INP')) AS pct_poor_inp FROM `acme.rum.vitals_events` WHERE ts >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 14 DAY) AND device = 'mobile' GROUP BY route HAVING visits >= 200 ORDER BY inp_p75_ms DESC LIMIT 50;
Performance Benchmarks & Trade-Offs
Measured deltas are mobile p75 from RUM across 42 commerce/media properties (2025), reported per-technique in isolation wherever possible.
| # | Technique | Metric | Mobile p75 change | Engineering cost | Primary trade-off / risk | | --- | --- | --- | --- | --- | --- | | 1 | Drop loading="lazy" on hero + fetchpriority="high" | LCP | 3.4 s → 2.1 s (−1.3 s) | ~15 min | Hero bytes now on the critical path — re-check size | | 2 | <link rel="preload" imagesrcset> for JS/CSS-injected LCP | LCP | −0.60 s | 1–2 h | Double download if imagesrcset/sizes/type mismatch | | 3 | preconnect to image + API origins in first 14 KB | LCP | −120 ms | 10 min | More than ~4 preconnects starves real requests | | 4 | AVIF + srcset via image CDN | LCP | −0.35 s Android / −0.08 s iOS | ~1 day | Decode adds 60–180 ms render delay on low-end Android | | 5 | Speculation Rules prefetch, moderate | LCP (next nav) | −0.80 s on prefetched navigations | 1–2 days | Wasted bytes on mispredicted links; analytics double-fire | | 6 | Speculation Rules prerender, conservative | LCP / TTFB | −1.90 s on activated prerenders | 2–3 days | Must gate 3P tags behind prerenderingchange | | 7 | scheduler.yield() after first paint in handlers | INP | 340 ms → 250 ms | 1–2 days | Shared state must be revalidated across yield points | | 8 | Defer chat/ABM/heatmap tags to interaction or postTask | INP | −140 ms | 0.5–2 days | Marketing attribution gaps; vendor sign-off required | | 9 | Split handlers into <50 ms tasks | INP | −180 ms | ~1 week | Architectural; needs per-feature time budgets in CI | | 10 | Metric-matched font fallback (size-adjust, ascent-override) | CLS | 0.11 → 0.03 | 2–4 h | Visible mismatch during the swap | | 11 | Reserved slot / overlay for consent banner | CLS | −0.12 | ~2 h | Design iteration; layout real estate | | 12 | contain-intrinsic-size with content-visibility: auto | CLS | −0.09 | ~3 h | A wrong placeholder size re-introduces the shift |
Complexity ranking for planning: priority hints (trivial) < speculation rules (moderate, needs analytics audit) < main-thread slicing (high, touches product code) < RUM attribution pipeline (high, but pays for everything else).
Pro-Tips & Common Pitfalls
* ❌ `loading="lazy"` on the hero. The most common single-cause LCP regression in the wild — 500–1000 ms of pure load delay. * ❌ Preloading without matching `imagesrcset`/`sizes`/`type`. Chrome fetches twice; DevTools prints preload was not used. * ❌ `fetchpriority="high"` on six images. You have recreated the default priority scheme with extra steps. * ❌ Compressing images while TTFB is 1.2 s. Fix the waterfall from the top: server → discovery → bytes → main thread. * ❌ Measuring INP in Lighthouse. Lab simulation cannot reproduce real input latency. Use RUM, or DevTools Performance panel → Interactions track with web-vitals-debug. * ❌ Averaging CWV. Means are meaningless; always p75 (and watch p95/p99 for tail pain). * ❌ Reporting raw paths. /product/12345 fragments your percentiles below statistical significance. * ❌ Flushing on `beforeunload`. Blocked on iOS Safari and disqualifies the page from bfcache. * ❌ Resetting CLS on SPA route change without a marker. CLS is per *page load*; soft navigations need explicit route_change events or your funnel pages look perfect and your landing page looks broken. * ❌ Prerendering without guarding analytics and ads. 8–15% session inflation and duplicated conversion pixels. * ✅ Enforce budgets in CI: LCP ≤2.5 s and INP ≤200 ms on a throttled Moto G4 profile; fail the build on regressions rather than triaging them after launch. * ✅ Alert on p75 per deploy SHA. A 40 ms INP regression shipped with a tag manager change is invisible without deploy-level segmentation. * ✅ Keep the LCP element inside the first 14 KB of HTML so it fits the initial congestion window and is discovered without layout. * ✅ Re-measure after every third-party change. Vendor script size is not correlated with vendor main-thread cost.
Frequently Asked Questions (FAQ)
Is `fetchpriority` safe to use across browsers, and what happens where it is unsupported? It is a pure hint. Chromium has honored it on <img> and <link> since v102, and Safari and Firefox have been progressively rolling out support — but the correct mental model is "progressive enhancement": where it is unsupported, the browser falls back to its default heuristic (Low for <img> until layout discovers it), which is exactly the behavior you had before. Because it can never *lower* your current performance, ship it unconditionally on the single LCP candidate, and verify the effect with RUM rather than assuming a universal win.
How does INP differ from FID, and why did my scores get worse after the migration? FID measured only the *input delay* — the time between the user's input and the moment the first event handler started. It ignored your handler execution and the render that followed, which is why sites with 5 ms FID routinely had 400 ms of felt lag. INP measures the entire pipeline (input delay + processing + presentation) through to the next paint, and aggregates near the 98th percentile of interactions rather than the median. Scores "dropping" after March 2024 is not a regression in your app; it is a stricter, more honest measurement of the same experience — and it moves the optimization target from "don't block the event loop before the handler" to "keep the whole interaction under 200 ms."
Why does my CrUX dashboard disagree with my own RUM numbers? Three structural reasons. First, CrUX is a 28-day rolling window at origin (and popular-URL) level for all visitors, while your RUM is usually sampled, route-templated, and often excludes bots, EU consent declines, or logged-out traffic. Second, CrUX has no per-deploy granularity — a 24-hour regression is diluted across 28 days, so your RUM will show it days before CrUX does. Third, aggregation differs subtly: CrUX applies p75 across page loads segmented by form factor, whereas a naive RUM query that mixes desktop and mobile or averages over interactions will drift. Reconcile by segmenting your RUM on the same dimensions (mobile/desktop, 28-day window, page-load grain), then treat CrUX as the authoritative tiebreaker for search-facing scores and your RUM as the fast-feedback instrument.
