PerformanceFeb 18, 2025·7 min read
Auditing a Next.js App from 45 to 98 Lighthouse Score
A systematic walk through image optimisation, font loading, bundle splitting, and Partial Pre-rendering that moved a production app from 45 to 98 in twelve days.
N
Nitin Shrivastava
Senior Software Engineer · Axelerant
A client came to us with a Next.js app sitting at a Lighthouse performance score of 45. The brief was simple: get it to 90+ without a rewrite. Twelve days later it was at 98. Here's the ordered hit-list.
The Audit Checklist
- check_circleReplace all <img> with next/image — eliminates CLS from unspecified dimensions
- check_circleUse next/font for all typefaces — zero layout shift on font swap
- check_circleEnable Partial Pre-rendering (experimental.ppr) for shell + streamed content
- check_circleTree-shake heavy icon libraries with optimizePackageImports
- check_circleMove analytics and chat scripts to next/script with strategy='lazyOnload'
next.config.ts
const nextConfig = {
experimental: {
ppr: "incremental",
optimizePackageImports: ["lucide-react", "@radix-ui/react-icons"],
},
images: {
formats: ["image/avif", "image/webp"],
deviceSizes: [640, 750, 828, 1080, 1200],
},
};speed
The single highest-impact change was enabling next/font. It eliminated 1.2 seconds of layout shift on a slow 3G connection and accounted for 18 Lighthouse points on its own.