Next.js Performance Hacks
Master Core Web Vitals and build blazing-fast Next.js apps
A performance optimization guide by make-it.run
Next.js 14+ with App Router
This guide covers the App Router. Most concepts apply to Pages Router too.
TL;DR
Focus on Core Web Vitals: LCP (loading), INP (interactivity), CLS (stability). Start with image optimization and font loading for quick wins. Use static generation by default, ISR for dynamic content. Measure in production with real user data.
Welcome to the definitive guide for optimizing Next.js application performance. This documentation covers everything from Core Web Vitals to advanced rendering strategies.
What's Inside
This guide is organized into focused sections, each tackling a specific aspect of performance optimization:
Core Web Vitals
Master the metrics that matter: LCP, INP, CLS, and how to optimize each one for real users.
Rendering Performance
Choose the right rendering strategy for each page: SSG, SSR, ISR, and streaming.
Bundle Optimization
Reduce JavaScript payload with code splitting, tree shaking, and dynamic imports.
Why Performance Matters
Performance isn't just about speed—it directly impacts:
| Impact Area | Effect of Poor Performance |
|---|---|
| User Experience | Higher bounce rates, lower engagement |
| SEO Rankings | Core Web Vitals are ranking signals |
| Conversion Rates | Each 100ms delay costs ~1% conversions |
| Accessibility | Slow sites hurt users on limited devices |
In a 2006 study, Amazon found that every 100ms of latency cost them 1% in sales. Google's Marissa Mayer discovered that a 0.5 second delay caused a 20% drop in search traffic. These findings have been consistently validated in more recent studies.
Quick Start: Performance Audit
Run a quick performance check on your Next.js app:
# Install Lighthouse CLI
npm install -g lighthouse
# Run audit
lighthouse https://your-site.com --viewCheck your Core Web Vitals in production:
// Add to your app
import { onLCP, onINP, onCLS } from 'web-vitals';
onLCP(console.log);
onINP(console.log);
onCLS(console.log);Key Optimizations at a Glance
Rendering Strategy
// Static Generation - Best TTFB
export async function getStaticProps() {
return { props: { data } };
}
// ISR - Fresh content, good performance
export async function getStaticProps() {
return {
props: { data },
revalidate: 60
};
}
// Streaming - Progressive loading
export default function Page() {
return (
<Suspense fallback={<Skeleton />}>
<SlowComponent />
</Suspense>
);
}Image Optimization
import Image from 'next/image';
// Optimized image with priority for LCP
<Image
src="/hero.jpg"
alt="Hero"
width={1200}
height={600}
priority
/>Code Splitting
import dynamic from 'next/dynamic';
// Load heavy components only when needed
const HeavyChart = dynamic(() => import('./Chart'), {
loading: () => <ChartSkeleton />,
ssr: false
});Core Web Vitals Targets
| Metric | Target | What It Measures |
|---|---|---|
| LCP | < 2.5s | Loading performance |
| INP | < 200ms | Interactivity |
| CLS | < 0.1 | Visual stability |
Learning Path
Understand Core Web Vitals Start with the Core Web Vitals overview to understand what metrics matter and why.
Measure Your Baseline Use the measuring guide to establish your current performance baseline.
Optimize LCP First LCP has the biggest perceived impact. Follow the LCP optimization guide.
Fix Layout Shifts CLS is often the easiest win. Check the CLS guide for quick fixes.
Improve Interactivity Make your app feel snappy with INP optimizations.
Advanced Techniques Dive into rendering strategies, bundle optimization, and caching for maximum performance.
Who This Is For
This guide is designed for:
- Frontend developers building production Next.js apps
- Tech leads establishing performance standards
- DevOps engineers setting up performance monitoring
- Anyone who wants their Next.js app to be fast
The Playbook
| Section | What You'll Learn |
|---|---|
| Core Web Vitals | LCP, INP, CLS in deep detail |
| Rendering | SSG, SSR, ISR, and streaming strategies |
| Bundle Optimization | Code splitting and tree shaking |
| Caching | CDN, route, and data cache layers |
| Images & Media | Image, font, and video optimization |
| Runtime | React and JavaScript performance |
| Edge & Network | Edge functions and middleware |
Realistic Expectations
With focused effort, most teams see significant improvements:
| Optimization | Typical Impact |
|---|---|
| Image optimization | 30-50% LCP improvement |
| Font optimization | 0.1-0.2 CLS reduction |
| Code splitting | 20-40% smaller bundles |
| Caching strategies | 50-80% faster TTFB |
| React optimization | 30-50% better INP |
Navigation Guide
Under time pressure? Start with Core Web Vitals Overview for quick wins.
Want to understand the system? Read through the LCP, INP, and CLS guides in order.
Know your problem already? Jump directly to the relevant metric guide based on your PageSpeed Insights results.
Setting up monitoring? Start with Measuring & Monitoring to track your improvements.
Related Guide
Performance and cost optimization go hand-in-hand. Faster pages often cost less to serve. Next.js Cost Hacks covers Vercel pricing, function optimization, and bandwidth reduction strategies.
Built by make-it.run — Perfectly engineered apps for startups
Book a call →
Information current as of January 2026. Performance best practices evolve—verify specifics with the latest Next.js documentation.