What are the main features of Next.js?

Next.js bundles routing, server and client components, multiple rendering strategies, a caching model, server-side APIs and asset optimization into one framework, so a React app is production-ready without assembling those pieces yourself.

Routing and rendering

  • App Router. File-system routing in app/ with nested layouts, loading.tsx, error.tsx, route groups, parallel and intercepting routes.
  • React Server Components. Server by default; add "use client" only where you need state, effects or browser APIs.
  • Partial Prerendering. With Cache Components, every route gets a static shell served instantly, and dynamic parts stream in behind <Suspense>.
  • Streaming of HTML and the RSC payload, so slow data never blocks the whole page.

Data and caching

  • "use cache" with cacheLife and cacheTag for explicit caching of functions and components.
  • On-demand revalidation with revalidateTag, updateTag and revalidatePath.
  • Server Functions (Server Actions) for mutations called directly from forms and buttons.

Backend

  • Route Handlers (route.ts) using the Web Request/Response APIs.
  • Proxy (proxy.ts, formerly middleware) for redirects, rewrites and header logic before routing.
  • after() to run work such as logging after the response is sent.

Optimization

  • next/image for responsive, lazy-loaded, modern-format images.
  • next/font to self-host fonts with zero layout shift.
  • next/script for third-party script loading strategies.
  • Metadata API for SEO, Open Graph images, sitemaps and robots files.

Tooling

Turbopack is the default bundler with a persistent disk cache, TypeScript is first-class, and the React Compiler is supported through reactCompiler: true. The dev server also exposes an MCP endpoint (/_next/mcp) so coding agents can read errors and routes.

Code example

tsx
1// One file per concern, all discovered by convention
2// app/
3// ├── layout.tsx shared shell (html/body)
4// ├── page.tsx "/"
5// ├── loading.tsx instant loading UI (Suspense)
6// ├── error.tsx error boundary for this segment
7// ├── blog/[slug]/page.tsx dynamic route "/blog/:slug"
8// ├── api/health/route.ts Route Handler "GET /api/health"
9// proxy.ts runs before matching requests
10
11// app/blog/[slug]/page.tsx
12import { cacheLife, cacheTag } from "next/cache";
13
14async function getPost(slug: string) {
15 "use cache";
16 cacheLife("days");
17 cacheTag(`post-${slug}`);
18 const res = await fetch(`https://cms.example.com/posts/${slug}`);
19 return res.json();
20}
21
22export default async function Post({ params }: PageProps<"/blog/[slug]">) {
23 const { slug } = await params;
24 const post = await getPost(slug);
25 return <article><h1>{post.title}</h1></article>;
26}

Practice this question

Open it in the study app to track progress, take notes, listen to the answer and work through the rest of the Next.js set.

Open in study app