Next.js Performance Cheat Sheet

Last Updated: November 21, 2025

Rendering Modes

Mode Best for
SSR Dynamic pages with user-specific data
SSG Pre-rendered marketing screens
ISR Semi-static pages with scheduled updates

Build & Cache Commands

next build
Produce production output
next export
Generate static export for plain hosting
Cache-Control: public, max-age=31536000, immutable
Set for static assets

Data Fetching Tips

Move heavy data fetching into server components or dedicated route handlers and keep payloads minimal.

💡 Pro Tip: Prefer `app` router streaming + incremental static regeneration for fast homepages.
← Back to Web Frameworks | Browse all categories | View all cheat sheets