← All ideas

Other: Avoid the full router.refresh() when the timezone cookie is first set

NewOtherIdea

On the first visit to the app, components/app/TimezoneCookie.tsx:46 sets the tz cookie and calls router.refresh(). That refetches the whole RSC tree (about 159 KB, mostly i18n messages) and costs one extra server render. Measured: 724 KB total on a first visit versus 561 KB on a returning visit, with the same FCP and LCP. First scope: refresh only on pages whose dates depend on 'today', or render those dates on the client. Once i18n messages are trimmed per route, the refresh gets cheaper by itself. Priority: medium. Effort: S.

Comments 0

No comments yet.