Skip to content

Next.js ​

Seven chapters on the framework that most senior frontend job adverts name by version. Chapters 01–05 are the framework itself. They show how the App Router maps files to routes, where data is fetched and cached, and how mutations run on the server. They also show how a route renders, and what runs before it, on which runtime. Chapters 06–07 cover production: authentication, and the point where Next.js starts to be your backend.

Written against Next.js 16. Nothing here assumes Vercel. The chapters name the platform only where a detail really differs, such as cold starts, regional execution, or which adapter runs the build.

⚠️ Moving target. Caching rules changed in Next.js 15 and again in 16. Version 16 also renamed middleware.ts to proxy.ts and made every request API asynchronous. Treat use cache, cacheLife and cacheTag as this year's names for a lasting principle. Caching is opt-in per request, and anything cached needs an explicit key that you can invalidate on purpose.

Chapters ​

#ChapterWhat it answers
01App Router Mental ModelHow do files become routes, and what re-renders on navigation?
02Data Fetching and CachingWhere does this request go, and how long does the answer live?
03Server ActionsHow do you mutate data without writing an API route — and safely?
04Rendering in Next.jsStatic, dynamic, streaming or partially prerendered — which, and why?
05Middleware, Runtimes and DeploymentWhat runs before the route, on which runtime, and where does the cache live when you self-host?
06Auth PatternsSession or token, and where is it checked?
07Route Handlers and the BFFWhen is Next.js your backend, and when should it stop being one?

What Interviewers Probe For ​

Two Next.js-specific questions, on top of the part-level signals in the Part III opener:

  • "Why is this page stale?" The answer walks a chain — the fetch, the cache entry, the revalidation key, and the CDN in front of it. Candidates who have only used the defaults describe the symptom. Candidates who have shipped a content site name the layer.
  • "What stops a user calling that Server Action directly?" Nothing. It is a public endpoint with a generated name. Authorisation and validation belong inside the action, every time. The most common security finding in App Router code is a Server Action trusted just because it sits beside its component.

Reading Order ​

Read 01 → 05 in order. The caching model in 02 explains the rendering choices in 04, and 03 assumes both. Chapters 06 and 07 stand alone and can be read in either order.

Interview sprint: 01 → 02 → 03 → 04. Rendering and caching are what the round asks about. Runtimes and deployment are what the job asks about.

The whole book, free to read. Generated from the manuscript on every change.

Your progress

Tick each chapter in the sidebar once you have read and understood it. Your name and email keep the ticks on any device.

Your name and email are stored to save your progress. Nothing else is done with them.