Core Web Vitals & Next.js: Achieving a 100 Lighthouse Score
Next.js & SEO
Back to Articles

Core Web Vitals & Next.js: Achieving a 100 Lighthouse Score

LCP, FID, CLS — these three metrics determine whether Google ranks you or buries you. A hands-on guide to diagnosing and fixing Core Web Vitals issues in Next.js applications.

Suleman Zaheer

Suleman Zaheer|سلیمان ظہیر

Full Stack Developer · UET Lahore, Pakistan

April 15, 20257 min read

Why Your Lighthouse Score Is a Business Metric

In May 2021, Google officially incorporated Core Web Vitals into its ranking algorithm as part of the Page Experience update. This transformed what had been a performance engineering concern into a direct SEO and business metric. A slow website is now algorithmically penalized in search results — meaning worse rankings, lower organic traffic, and fewer conversions, all as a direct consequence of technical performance failures.

The three Core Web Vitals each measure a different dimension of user experience: Largest Contentful Paint (LCP) measures perceived load speed. Cumulative Layout Shift (CLS) measures visual stability. Interaction to Next Paint (INP) measures responsiveness. A world-class Next.js application scores green in all three.

Largest Contentful Paint (LCP): The Perceived Load Speed Metric

LCP measures the time from page navigation to when the largest visible element has rendered. The target is under 2.5 seconds for 75% of page loads. In Next.js applications, LCP is almost always determined by the hero image or the largest text block in the above-the-fold area.

The Next.js Image Component: Never use a raw <img> tag in a Next.js application. The next/image component automatically generates modern WebP and AVIF formats (30-50% smaller than JPEG/PNG), lazy-loads off-screen images, and reserves space in the layout to prevent CLS. For your LCP image specifically, add the priority prop:

<Image
  src="/hero-image.jpg"
  alt="Suleman Zaheer - Full Stack Developer"
  fill
  priority
  sizes="(max-width: 768px) 100vw, 50vw"
  className="object-cover"
/>

Font Optimization: Google Fonts served through the standard link tag block rendering. Next.js's built-in next/font package downloads fonts at build time, serves them from your own domain, and applies size-adjust to eliminate font-swap layout shift. This change alone can reduce LCP by 0.5-1.5 seconds.

Cumulative Layout Shift (CLS): The Visual Stability Metric

CLS measures unexpected movement of page content as the page loads. The target is a score below 0.1. The primary causes in Next.js applications are images without explicit dimensions, dynamically injected content above the fold, and web fonts causing text reflow.

Images in Next.js with explicit width and height props (or fill inside a sized container) automatically get aspect-ratio styles applied that reserve the correct space before the image loads. This is the single most impactful CLS fix in most applications.

Interaction to Next Paint (INP): The Responsiveness Metric

INP measures how quickly your application responds to user interactions. The target is under 200 milliseconds. High INP scores mean your JavaScript is blocking the main thread. Use next/dynamic to lazy-load components that are not immediately needed:

import dynamic from 'next/dynamic';

const DataChart = dynamic(() => import('@/components/DataChart'), {
  loading: () => <div className="animate-pulse h-64 bg-surface-card rounded-card" />,
  ssr: false,
});

Third-Party Scripts: Analytics, chat widgets, and social sharing scripts are frequent INP culprits. Use Next.js's next/script with strategy="lazyOnload" to ensure they do not block the main thread during page initialization.

Measuring: The Tools That Matter

Lighthouse in Chrome DevTools measures synthetic performance (controlled conditions, no real user data). For real-world performance data, use Google Search Console's Core Web Vitals report — it shows your actual scores across real users on real devices and connections. The gap between synthetic and real-world scores is often significant, and real-world scores are what Google uses for ranking. Monitor both.

Conclusion

A 100 Lighthouse score on a Next.js application is not a moonshot — it is achievable for any project that uses Next.js's built-in optimization features correctly: next/image for all images, next/font for typography, next/dynamic for heavy components, and next/script for third-party scripts. The investment is a few hours of focused optimization work. The return — better search rankings, lower bounce rates, and a portfolio that demonstrates measurable technical quality — compounds indefinitely.

Topics Covered

Next.jsPerformanceCore Web VitalsSEOLighthouse

Found this helpful? Share it.

Suleman Zaheer

Written by

Suleman Zaheer | سلیمان ظہیر

Full Stack Developer from Lahore, Pakistan. CS student at UET Lahore. Building production-grade web applications with MERN Stack and Next.js, and writing about real-world software engineering.

Explore More Articles

9 in-depth technical articles on MERN Stack, Next.js, freelancing, UI/UX, and modern backend architecture.

View All Articles