Core Web Vitals: optimizing your site's performance
Core Web Vitals are an essential Google ranking factor. Here are concrete techniques for achieving optimal scores.
Core Web Vitals have been an official Google ranking factor since 2021. These metrics measure the quality of the user experience on your website in terms of loading speed, interactivity, and visual stability. Optimizing these metrics is no longer optional—it’s an SEO and UX imperative. This guide details the three key metrics and practical techniques for improving them.
The Three Core Web Vitals Metrics
LCP — Largest Contentful Paint
LCP measures the time it takes to display the largest visible element in the browser window (usually a hero image or a main text block). The goal is an LCP of less than 2.5 seconds.
Factors that negatively impact LCP:
- Unoptimized images (format, size, compression)
- Slow server (high TTFB)
- Render-blocking CSS and JavaScript
- Web fonts loaded late
INP — Interaction to Next Paint
INP (which replaced FID in March 2024) measures the page’s overall responsiveness to all user interactions (clicks, taps, keyboard input). The target is an INP of less than 200 milliseconds.
A poor INP means the browser is too busy executing JavaScript to respond quickly to user actions. This is particularly problematic on mobile devices, where processors are less powerful.
CLS — Cumulative Layout Shift
CLS measures the visual stability of the page. A high CLS means that elements move unexpectedly during loading (an ad that inserts itself, an image that shifts the text, a font that changes size). The goal is a CLS below 0.1.
Optimizing LCP: Advanced Techniques
Image optimization
Images are often the LCP element. Our recommendations:
- Use modern formats like WebP or AVIF (30–50% smaller than JPEG).
- Implement responsive images using the srcset and sizes attributes to serve the correct size based on the screen.
- Add fetchpriority="high" to the LCP image to tell the browser to load it first.
- Avoid lazy loading on the LCP image (it must load immediately).
- Use a CDN with image optimization (Cloudflare Images, Imgix, Vercel Image Optimization).
Reducing TTFB
Time to First Byte directly impacts LCP. To reduce it:
- Use an edge CDN to serve pages as close as possible to the user.
- Enable Brotli compression (more efficient than gzip).
- Cache HTML responses using stale-while-revalidate strategies.
- Optimize database queries (indexing, pagination, application cache).
Eliminate blocking resources
- Load critical CSS inline in the HTML and the rest asynchronously.
- Add defer or async to non-essential scripts.
- Use preconnect and preload for critical third-party resources.
Optimize INP: maximum responsiveness
Reduce JavaScript
JavaScript is the main cause of poor INP:
- Code splitting: load only the code necessary for the current page.
- Tree shaking: remove dead code from bundles.
- Lazy loading of components not visible on initial load.
- Replace heavy libraries with lightweight alternatives (e.g., date-fns instead of moment.js).
Optimize event handlers
- Use requestAnimationFrame for visual updates.
- Apply debounce to frequent events (scroll, resize, input).
- Offload heavy computations to Web Workers.
- Avoid layout thrashing (alternating DOM reads/writes).
Optimize CLS: visual stability
- Always define the dimensions of images and videos (width and height attributes or CSS aspect-ratio).
- Reserve space for ads and widgets with fixed-size placeholders.
- Use `font-display: optional` or `font-display: swap` with metrically similar fallback fonts.
- Avoid injecting content above the fold after initial loading.
- Use CSS containment to isolate dynamic areas.
Measure and monitor continuously
Optimization is not a one-time effort. We recommend:
- Google Search Console: Core Web Vitals report based on real user data (CrUX).
- PageSpeed Insights: detailed analysis with specific recommendations.
- Lighthouse CI: integrated into the CI/CD pipeline to detect regressions before deployment.
- Web Vitals JS library: collects real-world metrics directly in your analytics tool.
Concrete Results
On projects optimized by Pixee Play, we observe on average:
- LCP: reduced from 4.2s to 1.8s (57% improvement)
- INP: reduced from 350 ms to 120 ms (66% improvement)
- CLS: reduced from 0.25 to 0.04 (84% improvement)
- Organic traffic: 15–30% increase within 3 months of optimization
Conclusion
Core Web Vitals are not just a technical issue: they directly impact your SEO, your conversion rate, and your users’ satisfaction. At Pixee Play, we integrate performance optimization from the very start of every project and continuously monitor it after deployment. Contact us for a free performance audit of your site and a personalized action plan.