BACK TO LOGS
// Frontend DevelopmentMay 08, 20266 min read

Engineering a 100/100 Lighthouse Score Portfolio

Next.jsLighthouseWeb PerformanceSEO

Performance is a Feature

Many developer portfolios are visually rich but slow to load, containing heavy 3D canvases, uncompressed assets, and massive client-side JavaScript bundles. In a recruiter's queue, a website that takes 4 seconds to load is skipped. To stand out, especially to engineering leads at performance-oriented tech firms, your site must load instantly.

---

Step-by-Step Optimization Strategy

Here is the playbook we implemented to hit perfect Lighthouse scores on this portfolio:

1. Next.js 15 Image Component

We never use standard <img> tags. The Next.js <Image /> component automatically serves modern formats like WebP or AVIF, resizes images on demand, and inserts blur placeholders. We also set priority to the Hero section images to eliminate Cumulative Layout Shift (CLS).

2. Fine-Tuning Fonts with `next/font`

System default fonts look boring, but loading external web fonts causes rendering delay (FOIT/FOUT). We used Next.js's native next/font/google module. It downloads Google Fonts at build time, hosts them locally in the static bundle, and injects size-adjust CSS declarations to match the fallback font metrics, eliminating layout shifts.

3. Component Code Splitting & Dynamic Imports

We utilize heavy 3D visualizations and interactive canvas animations, but they are not needed for initial page load. We wrap the 3D Canvas in a dynamic import with ssr: false:

tsximport dynamic from 'next/dynamic';

const FloatingParticles = dynamic(
  () => import('@/components/FloatingParticles'),
  { ssr: false, loading: () => <div className="h-[400px] w-full animate-pulse bg-neutral-900" /> }
);

This cuts the main bundle size by 180KB, letting the browser render the text and basic styles instantly.

4. Inline CSS and Tailwind CSS v4 Compiler

Tailwind v4 features a rewritten compiler engine that compiles stylesheets much faster and outputs highly optimized utility CSS. We purged all unused animation classes and ensured there is zero custom CSS render-blocking.

---

The Result

Through these changes, we achieved:

  • **First Contentful Paint (FCP):** 0.4s
  • **Speed Index:** 0.8s
  • **Time to Interactive (TTI):** 0.9s
  • **Lighthouse Performance Score:** 100/100

By demonstrating this level of optimization, you show recruiters that you don't just write functional code, you write code that is optimized for real-world user conditions.