You are the front-end lead for an online retailer with 14 customer-facing web properties (storefront, search, product pages, checkout, account, blog, several country sites) owned by 20 teams. Search Console shows that most URL groups fail Core Web Vitals on mobile: INP is the worst, LCP is borderline, and CLS spikes on product pages. Marketing keeps adding third-party tags. Previous "performance sprints" improved numbers for a month, then they regressed.
The VP of Engineering asks you to design an org-wide web performance program that gets the important page groups to "good" Core Web Vitals within three quarters and keeps them there.
Cover measurement (lab and field), targets and budgets, tooling and CI gates, the technical playbook for the common problems, how third-party scripts are governed, ownership and incentives across 20 teams, and how you would report progress and prove business impact.
The telling detail in the brief is that previous performance sprints worked, then regressed. That means the organisation knows how to make pages fast but has no system that keeps them fast. Performance is an emergent property of hundreds of daily changes by 20 teams plus marketing's tag manager; a one-off project cannot hold it.
So the program is designed like any other platform:
The technical fixes matter, but they are the easy part. The hard part is the operating model.
Five pieces:
Everything is reported by page group (a route template), never by raw URL:
pageGroups:
- id: product-detail
match: "/p/:slug"
owner: team-product-page
tier: 1 # tier 1 = revenue critical
targets: { lcp_p75_ms: 2500, inp_p75_ms: 200, cls_p75: 0.1 }
budgets:
js_initial_kb_gz: 170
third_party_js_kb_gz: 80
lcp_lab_ms: 2200 # Lighthouse CI, mobile profile
image_lcp_kb: 120
- id: checkout
match: "/checkout/*"
owner: team-checkout
tier: 1
targets: { lcp_p75_ms: 2500, inp_p75_ms: 150, cls_p75: 0.05 }
This file lives in the repository, is reviewed like code, and drives dashboards, CI budgets and alert routing.
{
"metric": "INP",
"value": 412,
"pageGroup": "product-detail",
"release": "storefront@2025.06.02-a1b2c3",
"device": { "class": "mobile-low", "memoryGB": 4, "cores": 8 },
"connection": "4g",
"country": "IN",
"navigationType": "navigate",
"attribution": {
"interactionTarget": "button.size-selector",
"interactionType": "pointer",
"inputDelay": 96,
"processingDuration": 251,
"presentationDelay": 65,
"longestScript": { "url": "https://cdn.acme.com/_next/static/chunks/pdp.js", "durationMs": 210, "invoker": "click" }
},
"experiments": { "pdp-gallery-v2": "treatment" }
}
The web-vitals attribution build plus the Long Animation Frames (LoAF) API identify which script and which
handler caused a slow interaction, which is what makes INP actionable.
Performance budget report: product-detail
Initial JS (gz): 168 KB / 170 KB (+6 KB) ok
Third-party JS: 74 KB / 80 KB ok
Lighthouse LCP: 2.41 s / 2.20 s FAIL
Largest new module: react-zoom-pan (+23 KB) imported in Gallery.tsx
perf-budget check --page-groups perf/page-groups.yaml --stats .next/analyze/stats.json
lhci autorun --config lighthouserc.json # median of 3–5 runs per URL, mobile emulation
Gates: bundle budgets are blocking (deterministic); Lighthouse lab metrics are blocking only for large regressions (variance in lab runs makes small thresholds flaky) and otherwise warn. Overrides need a code-owner from the performance guild plus a ticket.
A request form (owner, purpose, page groups, expected size, loading strategy, data shared, expiry date), reviewed by the performance and privacy owners. Tags have a budget per page group and an expiry; expired tags are removed automatically unless renewed.
| Source | Strengths | Limits | Use |
|---|---|---|---|
| CrUX / Search Console | What Google uses; free | 28-day lag, Chrome only, coarse segmentation, no attribution | Executive target and SEO |
| Own RUM | Daily, segmented, attribution, joins with releases and experiments | Needs SDK and pipeline; sampling | Primary operational metric |
| Lighthouse CI / WebPageTest | Deterministic-ish, per PR, detailed traces | Not real users; cannot measure INP (only TBT as a proxy) | Regression prevention |
| Synthetic monitoring (SpeedCurve, Calibre, DebugBear) | Scheduled production checks, competitor benchmarks | Lab conditions | Early warning, trend |
Commercial RUM (SpeedCurve, Datadog RUM, Sentry, Akamai mPulse, DebugBear) versus in-house: if an observability platform exists, add vitals with attribution to it rather than buying a separate tool. The decisive features are attribution, segmentation by page group and release, and the ability to join with experiment variants.
INP (the worst metric here)
scheduler.yield() where supported, with a
setTimeout-based fallback), do the visual update first and defer the rest.startTransition, useDeferredValue) keep inputs responsive
during expensive re-renders.LCP
<img> in server HTML (not a client-rendered carousel), with
fetchpriority="high"; never lazy-load the LCP image.srcset/sizes, AVIF/WebP, correct dimensions, CDN caching.font-display: swap or optional, preload only the critical font, subset.<head> removed.unload handlers, no Cache-Control: no-store on HTML unless needed)
and the Speculation Rules API to prerender likely next pages (for example, from listing to product).CLS
width/height or aspect-ratio on images and embeds; fixed-height slots for ads and promotional
banners; skeletons with final dimensions.size-adjust, ascent-override) to reduce swap shifts.transform, not layout properties.The playbook is turned into platform components and lint rules (an <Image> that requires dimensions and sets
priority for above-the-fold, a <Script strategy> loader, a font package, an ESLint rule against unload handlers),
so teams fix classes of problems once.
Not every page matters equally. Rank page groups by traffic × revenue × gap to target, start with product detail and listing pages on mobile, and focus on the largest contributor per metric shown by attribution. Typical early wins: LCP image priority and sizing, removing two or three heavy tags, hydration reduction on product pages.
Third parties are frequently the single largest INP and main-thread cost on retail sites, and they are owned by people outside engineering. The program needs:
<head>; A/B test tag impact when
disputed (a tag-off holdout often settles arguments quickly).Leadership attention fades unless performance is tied to money. Methods:
Lighthouse scores are 95 but CrUX fails. Why? Lighthouse runs one simulated device on a clean load, without user interactions, consent banners, logged-in state or real third-party behaviour. INP cannot be measured by Lighthouse at all. Trust the field data and use lab tools for regression detection.
A product manager wants a new personalization script that adds 150 ms of main-thread time. What do you do? Show the cost against the page group's budget, propose alternatives (server-side personalization, deferred loading), and if it must ship, run it as an experiment measuring both its benefit and the INP/conversion cost. Make the trade-off explicit and let the owner decide with data.
Should the budget gate block merges? Deterministic budgets (bundle size) should block with an override process. Noisy lab metrics should block only on large regressions. Field regressions trigger alerts and the error-budget policy rather than blocking deploys.
SPA route changes are not captured by Core Web Vitals. Does that matter? INP covers interactions across the whole page life, including after soft navigations, but LCP and CLS are tied to the initial load. Measure custom route-transition timings in RUM for SPAs, and watch for Chrome's soft-navigation measurement work, which may extend vitals to route changes.
How do you keep the program alive once targets are hit? Budgets and alerts remain, page-group ownership is permanent, targets move into team OKRs as health metrics, and the monthly review continues with a lighter cadence. The platform team shifts from fixing to enabling.
Spotted a mistake or a rights concern? Report an issue