Back to Insights
Web Development

Core Web Vitals Playbook: Achieving 100/100 Lighthouse Performance Scores

A step-by-step engineering checklist to eliminate render-blocking CSS, optimize font loading, shrink bundle sizes, and achieve top Lighthouse performance.

Muhammad Taki Ahmed
Muhammad Taki AhmedFounder & Chief Technical Editor at Raydrim
August 3, 2024
5 min read
Core Web Vitals Playbook: Achieving 100/100 Lighthouse Performance Scores

Understanding LCP, INP, and CLS Metrics

Google’s Core Web Vitals measure Largest Contentful Paint (LCP < 2.5s), Interaction to Next Paint (INP < 200ms), and Cumulative Layout Shift (CLS < 0.1). Passing these thresholds boosts search engine rankings.

Performance is no longer just a user experience metric; it is a critical SEO factor. Google's algorithm explicitly rewards websites that pass the Core Web Vitals assessment. Achieving a 100/100 Lighthouse score requires meticulous engineering and a deep understanding of browser rendering phases.

  • Largest Contentful Paint (LCP): Measures loading performance. The largest image or text block in the viewport must render within 2.5 seconds.
  • Interaction to Next Paint (INP): Replaced FID. It measures responsiveness. When a user clicks a button, the visual feedback must occur within 200 milliseconds.
  • Cumulative Layout Shift (CLS): Measures visual stability. Elements should not jump around as the page loads, which causes frustrating accidental clicks. Target score is below 0.1.

Next/Image & Next/Font Edge Optimization

Utilizing next/image automatically converts images into AVIF/WebP formats resized dynamically for user viewports. Next/font self-hosts Google Fonts locally with zero layout shift during font swap.

Images and fonts are the most common culprits for poor LCP and CLS scores. At Raydrim, we strictly enforce the use of the Next.js built-in optimization components.

next/image prevents Layout Shift by requiring explicit width and height dimensions (or aspect ratios). It automatically serves next-gen formats like AVIF, which are significantly smaller than JPEGs. It also handles lazy loading out of the box, ensuring below-the-fold images do not block initial rendering.

next/font eliminates the dreaded flash of unstyled text (FOUT) and layout shifts associated with web fonts. It downloads the font files at build time and serves them from the same domain, adjusting the CSS size-adjust property to ensure the fallback system font matches the exact dimensions of the custom web font.

Dynamic Imports & Code Splitting

Lazy-loading heavy client components like WebGL canvases or interactive modals using next/dynamic keeps initial JavaScript payload under 70KB gzip.

To achieve an excellent INP score, the main thread must be free to respond to user input. If the browser is busy parsing and executing a massive JavaScript bundle, the page will freeze.

We aggressively code-split our applications. Components that are not immediately visible on initial load—such as complex modals, heavy charting libraries, or components below the fold—are dynamically imported.

import dynamic from 'next/dynamic'

// This component is split into a separate chunk and loaded only when needed
const HeavyThreeJSViewer = dynamic(() => import('../components/HeavyThreeJSViewer'), {
  loading: () => <p>Loading 3D Viewer...</p>,
  ssr: false // Optional: Disable server-side rendering for client-only libraries
})

By keeping the critical path lean, we ensure the browser can parse the HTML, render the CSS, and become interactive almost instantaneously.

Achieving Speed Supremacy

Attaining a perfect Lighthouse score is an ongoing commitment to performance engineering. It directly impacts SEO, user retention, and conversion rates.

Audit your site speed and let us refactor your frontend for maximum performance with Raydrim Web Architecture Services.

#Lighthouse#Performance#Core Web Vitals#Next.js#SEO
Share this article
Muhammad Taki Ahmed

Written by Muhammad Taki Ahmed

Founder & Chief Technical Editor at Raydrim

Muhammad leads Raydrim’s architecture division, specializing in high-performance React frameworks, mobile engineering, and enterprise cloud solutions.