Next.js — Advanced
1. Rendering-Strategy Tradeoffs, In Depth
This is the single most consequential architectural decision in any real Next.js app, and it's durable as a concept even though the exact API names implementing each strategy have changed across versions.
A genuinely common real mistake: defaulting every page to per-request rendering "to be safe," when most of an app's pages don't actually need per-visit freshness — this quietly adds real latency and server cost across the entire app for no actual freshness benefit on pages where the underlying data barely changes. (needs verification — exact current API names for each strategy; confirm against current Next.js docs before writing any specific one into production code)
2. Caching and Revalidation
Ahead-of-time-rendered content isn't rendered exactly once forever — Next.js provides mechanisms to refresh (revalidate) that content on a schedule or in response to an event, without falling all the way back to per-request rendering for the whole page.
Caching bugs in Next.js are a genuinely common real production issue — a page silently serving stale data because a revalidation window/trigger wasn't configured the way the developer assumed. See the Troubleshooting tab for a concrete example.
3. Streaming and Progressive Rendering (as a concept)
Rather than waiting for every piece of data a page needs before sending any HTML to the browser, a page can send its fast-to-render parts immediately and stream in slower parts as they become ready — the visitor sees useful content sooner instead of staring at a blank page until the single slowest data source resolves.
(needs verification — exact current streaming API/mechanism)
4. Deployment and Edge-Runtime Concepts
Some hosting environments let server-side code run geographically closer to the visitor (an "edge" runtime) rather than in one central region — potentially reducing latency for globally-distributed users. This is a real, durable infrastructure concept, but which parts of a Next.js app can actually run in such an environment (and what limitations apply there vs. a traditional server runtime) is genuinely version- and provider-specific. (needs verification — exact current edge-runtime capabilities/limitations; confirm against current Next.js docs and your specific hosting provider before relying on this for a real app)
5. Performance Optimization
Beyond picking the right rendering strategy per page, real performance work in a Next.js app generally covers:
useMemo/useCallback — profile first, optimize deliberately.Try It (2 Minutes)
Pick a page you built in the Intermediate tab's exercises and explicitly ask: does this page's content actually need to be regenerated on every single visit, or would it be correct (and faster) rendered ahead of time with periodic revalidation? Write down your reasoning in one sentence before checking current docs for the exact API to implement your answer — the reasoning is the durable skill; the API name is the part that needs verification.

