intermediate · 26 minute study
Choose rendering by freshness, authority and cost
Rendering strategy is a product decision about when HTML is produced and where data becomes available. It determines what hosting can support.
Useful preparation · 1 prerequisite
Use this as a map, not a lock. If these ideas are familiar, continue.
- Read an App Router application as a route tree — Framework conventions are easier to navigate when you know which file owns a URL, which file supplies shared UI and which file handles a failure.
First, build a mental model
Static rendering prepares a reusable answer early. Request rendering prepares an answer for a request. Browser rendering computes UI after files arrive. A product can combine these at different boundaries.
- Use prebuilt public content when the required information is known during the build. Client JavaScript can add local interaction and fetch suitably authorized external data later.
- Use a supported request runtime when the HTML or operation must depend on request-time cookies, protected data or a changing server decision. That changes the hosting contract.
- With output: 'export', Next.js emits a static artifact. Supported build-resolved GET handlers can emit static responses, but a request-time POST mutation cannot become an active server merely by living in route.ts.
- Check the installed framework version and its feature support. Static export, server rendering, client interactivity and cache behavior are separate decisions; do not infer them from a file's extension.
// next.config.mjs: a static hosting contract
const nextConfig = { output: 'export' };
export default nextConfig;
// Build output is served as files.
// Request-time protected writes need a trusted runtime elsewhere.- Public lesson
Its explanation can be rendered during a build and reused for many learners.
- Local practice
An answer changes browser state without requiring a private application server.
- Private operation
A hypothetical protected order write requires fresh identity/authorization at a trusted endpoint, outside a files-only hosting contract.
Production thinking
Take this beyond the example.
LearnLab uses inexpensive static Pages delivery. The audited production reference uses a different Next.js deployment model with OpenNext on Workers. Teach that distinction without migrating a learning product that does not need it.
Your evidence
unseen is a local learning signal, not a credential or proof of production competence.
Explain the mental model, then explicitly acknowledge it. Opening a page is not evidence.
Supported retries can complete this lesson. Independent evidence and delayed review determine the skill stage.
Next lesson · A cache key is a claim that two answers are interchangeable →