All Articles
PerformanceNov 202510 min read

Performance Optimization: From 60 to 100 Lighthouse

Practical techniques for optimizing Core Web Vitals including image optimization, code splitting, and eliminating render-blocking resources.

PerformanceCore Web VitalsLighthouseOptimization

Performance Is a Feature

A fast website isn't a nice-to-have. It directly impacts conversion rates, SEO rankings, and user satisfaction. Here's how to systematically improve your Lighthouse score.

Core Web Vitals

Focus on the three metrics that matter:

LCP (Largest Contentful Paint) < 2.5s

  • Preload critical images
  • Use responsive image formats (WebP, AVIF)
  • Optimize server response time
  • Remove render-blocking resources
  • FID / INP (Interaction to Next Paint) < 200ms

  • Break up long tasks
  • Use web workers for heavy computation
  • Defer non-critical JavaScript
  • Optimize event handlers
  • CLS (Cumulative Layout Shift) < 0.1

  • Set explicit dimensions for images and videos
  • Reserve space for dynamic content
  • Avoid inserting content above existing content
  • Use CSS containment
  • Image Optimization

    Images are typically the biggest performance bottleneck:

    html
    <Image
      src="/hero.jpg"
      alt="Hero image"
      width={1200}
      height={600}
      priority
      sizes="(max-width: 768px) 100vw, 80vw"
    />

    Use Next.js Image component for automatic optimization, lazy loading, and responsive sizing.

    Code Splitting

    Don't ship code users don't need:

  • Dynamic imports for route-based splitting
  • React.lazy for component-level splitting
  • Tree shaking for unused exports
  • Bundle analysis to find hidden bloat
  • Font Optimization

    Fonts can block rendering:

  • Use `next/font` for automatic optimization
  • Subset fonts to include only needed characters
  • Use `font-display: swap` for immediate text rendering
  • Preload critical fonts
  • Measuring and Monitoring

    Set up continuous performance monitoring:

  • Lighthouse CI in your deployment pipeline
  • Real User Monitoring (RUM) for field data
  • Performance budgets to prevent regression
  • Regular audits and optimization sprints
  • Performance is not a one-time fix. It's an ongoing discipline that requires measurement, monitoring, and continuous improvement.

    Related Articles