1. Mastering Largest Contentful Paint (LCP < 2.5s)
LCP measures how quickly the primary viewport content loads. In Next.js, prioritizing the hero image with fetchpriority='high' and preconnecting to font CDNs drops LCP below 800ms.
- Convert all raster images to WebP and AVIF with Next.js built-in image optimization.
- Preload critical Google fonts locally using next/font.
- Defer non-essential tracking scripts with next/script strategy='afterInteractive'.
2. Eliminating Cumulative Layout Shift (CLS < 0.1)
Layout shift happens when elements load dynamically without reserved dimensions. Always assign explicit width and height ratios to image containers and skeleton loaders.
