← Back to article
Illustrative scenario

One shopping screen. Two ways of asking the server.

Each part asks separately 4 requests (illustrative)
4 IDENTICAL REQUESTS Header Menu Orders Settings 1 2 3 4 Server same answer, four times
  • 9:00Header opens and asks the server for your profile
  • 9:00Menu and orders card ask for the same thing
  • 9:00Settings sends a fourth identical request
  • 9:02You come back to the screen — everything asks again; spinners return
  • —Every visit pays the full network cost
4Requests
SpinnersOn return
NeverData reused
With TanStack Query 1 shared request (illustrative)
SHARED, THEN REUSED Header Menu Orders Settings Saved copy 1× refreshed only when needed Server
  • 9:00Four parts of the screen want your profile
  • 9:00One shared request while it loads
  • 9:00Answer saved; all four parts fill in together
  • 9:02You come back to the screen — the saved copy shows instantly
  • 9:02Quietly refreshed in the background when needed
1Shared request
InstantOn return
While cachedData reused

Only the data layer differs. The screen, the server, and the features are identical.