Loading articles…
Loading articles…
Loading article…
Loading article…
A slow interface is often a data-flow problem disguised as a rendering problem. The useful question is not “how do we add a spinner?” but “where should this data be fetched, and what must wait for it?”
In a React framework with server components, render data-heavy regions on the server when they can query the database or an API directly. Keep browser-only behavior—input state, event handlers, local storage, maps, and other browser APIs—in small client components. This keeps credentials and query code off the client and avoids shipping interaction code for static content.
A client component is not a faster version of a server component. It is a boundary that opts a subtree into browser JavaScript. Make that boundary close to the interaction that needs it: a filter button can be client-side while the page heading, article body, and initial data remain server-rendered.
If a page awaits request A before it even starts independent request B, total latency becomes the sum of both waits. Start independent promises first, then await them together. Keep sequential work only when B truly needs a value returned by A, such as fetching an account's projects after resolving the account ID.
A server-rendered route can still be blocked by its slowest awaited query. Put a meaningful loading boundary around the region that can arrive later, so stable page structure can render first. The fallback should preserve the content's shape and announce loading accessibly; it should not conceal a request that is failing repeatedly.
The fastest request is the one you did not put in the user's critical path.
Keep data access in a server-only module, pass serializable results into interactive components, and show slow regions behind explicit loading boundaries. This gives the team clear places to review authorization, caching, and client bundle growth as the page evolves.
Senior Full-Stack Software Engineer
Newsletter
New articles from our engineers, straight to your inbox. One email a month, no spam.