Core Web Vitals: A Practical Guide for Developers
Core Web Vitals sound like exam grades, but each one describes a moment a real person experiences: how fast the main content appears, how quickly the page responds to input, and whether things jump around while loading. Google uses them as ranking signals, but the stronger argument is simpler — slow and janky pages lose visitors.
The three metrics
- LCP (Largest Contentful Paint) — when the biggest visible element renders; target under 2.5s
- INP (Interaction to Next Paint) — how long the page takes to visually respond to a tap or click; target under 200ms
- CLS (Cumulative Layout Shift) — how much the layout jumps during load; target under 0.1
Improving LCP
The LCP element is usually the hero image or the main heading. The fixes are unglamorous: compress and correctly size the image, preload it, make sure it isn't blocked by render-hanging scripts, and serve it from a cache-friendly CDN. On text-led pages, the biggest win is often simply inlining the critical CSS.
- Identify the LCP element in browser DevTools
- Compress it and set explicit width/height
- Preload the image if it loads late in the request chain
- Remove unused JavaScript blocking first render
Fixing INP
INP problems almost always trace back to long main-thread work: a heavy script running on load, or a click handler that does too much at once. Break long tasks up, defer anything non-critical, and move heavy computation out of the interaction path. A small `requestAnimationFrame` split can turn a frozen tap into a smooth one:
js
button.addEventListener('click', () => {
requestAnimationFrame(() => {
// heavy work in the next frame — the UI stays responsive
updateComplexState();
});
});Keeping CLS low
- Reserve space for images and embeds with width/height or aspect-ratio
- Never inject banners or cookie bars above existing content
- Use font-display: swap and preload key fonts to avoid text jumps
- Lazy-load below-the-fold content without shifting what's above it
“Most layout shift is caused by something a developer forgot to reserve space for.”
Measure with real field data (CrUX / PageSpeed Insights) rather than only lab runs — real devices on real networks behave differently from a desktop throttled in the lab. For the official thresholds, web.dev's Core Web Vitals page stays current.
Sample article — preview content for this portfolio design.
Written by
Anurag Singh
Digital Marketing Expert
I specialize in digital marketing, SEO, and web development, helping businesses improve search visibility, strengthen their online presence, and grow through effective digital strategies.