Interview kitsBlog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2026 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Next.js
Next.jshard

Name two practical ways to improve Next.js performance.

Tags
#performance#bundling#next-image
Back to categoryPractice quiz

Answer

Keep as much as possible in Server Components (less JS), and split heavy client code with dynamic imports. Also use `next/image` for optimized images and avoid huge providers on the client.

Advanced answer

Deep dive

Performance in Next.js is mostly about (1) **how much JS you ship**, and (2) **how much work you can cache**.

Practical improvements (more than two)

  • **Reduce client JS**: keep the tree server-first, push `'use client'` down, avoid heavy client providers at the root.
  • **Code-split heavy widgets**: dynamic imports for rarely used components.
  • **Optimize images**: `next/image`, correct sizing, and sensible formats.
  • **Cache and revalidate**: use cached `fetch` + `revalidate` instead of rendering everything per request.
  • **Avoid waterfalls**: start fetches in parallel.
  • **Fonts**: `next/font` helps reduce layout shifts.

Example (code splitting)

import dynamic from 'next/dynamic'

const Chart = dynamic(() => import('./Chart'), { ssr: false })

Common pitfalls

  • Making a top-level layout a Client Component.
  • Passing huge JSON payloads to the client.
  • State too high in the client tree causing broad re-renders.

Related questions

Next.js
`next/link` prefetching: what does it do and how can you control it?
#nextjs#link#prefetch
Next.js
What does `next/font` solve and how does it reduce layout shift (CLS)?
#nextjs#fonts#performance
Next.js
What does `next/image` do for you (and why use it)?
#nextjs#images
#performance
Next.js
What is code splitting and how does `dynamic()` help in Next.js?
#code-splitting#dynamic-import#performance
Next.js
Edge runtime vs Node.js runtime in Next.js — when choose which?
#edge#runtime#nodejs
Operating Systems
Explain virtual memory and paging.
#virtual-memory#paging#performance