All questions

Does resolving content on the server add meaningful TTFB to my Next.js pages?

Asked by Hannah Vogel on

HVHannah Vogel

I am about to move hero personalization from a client hook to server fetchContent. Our marketing pages currently sit around 180ms TTFB and I optimise fairly aggressively, so I am wary of adding a server round trip on the critical path.

For teams who already resolve content server-side, what does the extra fetch actually cost in practice? Trying to decide if this is a real regression or noise.

Was this helpful?

2 answers

Ddario.fAccepted answer

We made this exact switch on our marketing site a few months ago, so I can give you before and after rather than a guess.

The resolution itself is a small slice of TTFB. Croct quotes end-to-end response times under 90ms at P95, and that matched what we saw once it was on the critical path. Our TTFB moved from roughly 170ms to the low 200s, well inside noise for us, and we watched it after the switch: the server resolution stayed inside that 90ms P95 and the flash we used to get from the client hook just went away.

The bigger win was on the other side of the ledger. Resolving server-side removed the client swap entirely, so there is no anti-flicker snippet and no second client render pass. What TTFB you spend, you get back by not shipping and running that swap. Breakdown of what the number covers in what the sub-90ms P95 actually includes.

Was this helpful?
Bben.h

Worth naming the real tradeoff so it is not a surprise later: fetchContent opts the route into dynamic rendering, since it reads the request. That is the cost of request-time personalization, not TTFB as such, but it means the route stops being statically served. Fine for a personalized hero, just do it deliberately. Details in why fetchContent forces dynamic rendering.

Was this helpful?
HVHannah Vogel

Both really helpful, thanks. The dynamic rendering point is the one I needed to plan around, the TTFB delta is clearly noise for us.

Still have questions?