skip to content

Routes & Layouts

How a URL becomes a page: segments matched from the file tree, a chain of nested shells, and navigation between them without a document load. Asked because the model decides what re-runs on each move.

on this pageshow

explore

questions

page 2 of 2

How do you decide whether a site's redirects belong in a build-declared table or in per-request code?

level: principalimportance: should knowfreq 42%

basics

~20 s

Start from what the rule needs to know. Path-only rules belong in the declared table, where they are cheap, cacheable and reviewable. Rules depending on identity, experiment or database state need per-request code, paying compute and cacheability for that access.

open as a page

A link's payload was prefetched minutes before the user clicked it — what can go wrong, and how do you bound it?

level: seniorimportance: nice to knowfreq 40%

basics

~20 s

A speculative payload ages between fetch and click, so it can render data minutes old or computed under a context the user has left. Bound it with a short hold window, a revalidation on click, or code-only prefetching.

open as a page

Your streamed pages flush the shell early, but a deep segment resolves a head tag late. How do you decide what to do?

level: principalimportance: nice to knowfreq 40%

basics

~20 s

Decide by who must see the tag. The head leaves in the first bytes and cannot be edited afterwards in-band, so the choices are: delay the flush, resolve the head in an earlier pass, move the declaration up, or inject late for browsers only.

open as a page

showing 31–33 of 33