Back to Blog

Optimize Core Web Vitals

Improve LCP, INP, and CLS with measurable budgets, prioritized images and scripts, and a release workflow that catches regressions early.

Posted by

Related reading

Ship with the App Router

Use server components, nested layouts, and streaming in the Next.js App Router to build fast pages with less client JavaScript.

Authentication with Supabase

Add Google sign-in, magic links, and protected routes with Supabase Auth using the helpers already wired into Indiexyz.

Connect Stripe Checkout

Use Stripe Checkout to accept one-time payments and subscriptions with hosted payment pages, webhooks, and production-ready success routing.

Illustration of LCP, INP, and CLS performance metrics

Measure before optimizing

Core Web Vitals describe how a page feels: whether the main content arrives quickly, whether interactions respond promptly, and whether the layout stays stable. Establish mobile and desktop budgets before changing code.

1. Protect the largest image

Your LCP element should not compete with hidden animations, large fonts, or blocking scripts. Preload the hero asset when needed, serve responsive sizes, and make the fallback background occupy the same space as the final image.

2. Break long interaction work

Input delay often comes from one large task. Split heavy loops, avoid synchronous work after click, memoize expensive derived values, and keep hydration boundaries small so the browser can respond while the page settles.

3. Reserve every dynamic box

Give ads, badges, embedded media, and async lists explicit height or aspect ratios. A layout that never shifts is faster to use, even when the network is slow.

4. Add a release gate

Run Lab checks on key templates and collect field data after release. A page that passes on a fast laptop can still fail on a mid-range phone, so test the devices your customers use.