How do I keep most of the page cached but personalize one slot?
marketing page, mostly static, built with ISR and revalidate on a tag. only one slot near the top needs to be personalized per visitor. everything else is the same for everyone.
i do not want the whole route to flip to dynamic just because of that one region. is there a way to keep the rest of the page cached the way it is now and only pay the dynamic cost on the personalized slot?
1 answer
The key fact to design around is that calling fetchContent reads the request, so it opts the whole route into dynamic rendering. There is no per-call flag that keeps the surrounding route static once the request is read. The rendering modes and this behavior are described in content rendering and dynamic rendering.
So the pattern is to isolate the personalization to the slot rather than the page. Resolve that one region on its own, for example inside a Suspense boundary that streams the personalized slot while the static shell is sent first, or as a separately fetched segment, so the rest of the page keeps its cached, static path. The server fetchContent reference shows the slot-level fetch.
Note that ISR on its own serves the same HTML to everyone, so request-level personalization cannot come from the ISR output itself, it needs dynamic rendering or streaming for that one region. That constraint is explained in ISR serves everyone the same HTML and the dynamic conversion in why fetchContent forces dynamic rendering.
One operational tip: pin the slot version, for example home-hero@2, so a later publish does not silently change what that region resolves to.