You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TanStack Query illustrates this so well. It does not need a special "RSC mode". Once the RSC payload is part of an async query, you still get explicit cache keys, `staleTime`, background refetching, and the rest of Query's toolbox. For static content, just set `staleTime: Infinity` and you are done.
> Navigate from `/posts/abc` to `/posts/xyz` and the loader runs again. Navigate back to `/posts/abc` and Router can serve the cached result instantly. That snappy back-button experience falls out of the same loader caching model you are already using.
162
171
172
+
### CDN: Cache The GET Response Itself
173
+
174
+
Because GET server functions are still just HTTP under the hood, you can also cache the response itself at the CDN layer.
returnrenderToReadableStream(<h1>Hello from the server</h1>)
191
+
})
192
+
```
193
+
194
+
That is the same pattern we use here for blog and docs content. Browser cache rules can stay conservative while the CDN caches the server function response much more aggressively.
195
+
163
196
With Start, RSCs fit into the same data workflows you already use.
164
197
165
198
## Security: One-Way Data Flow
@@ -224,17 +257,19 @@ That is the tradeoff:
224
257
225
258
That is why we think they matter. Not because every route should become a server component. Because when you use them where they fit, the payoff is measurable and not subtle.
226
259
227
-
## Introducing Composite Components, the anti-`'use client'`
260
+
## Introducing Composite Components
228
261
229
262
Everything above stands on its own. If all TanStack Start did was treat RSCs as fetchable, cacheable, renderable data, we would already think that was a better foundation for RSCs.
230
263
231
264
But we kept pulling on one question: what if the server did not need to decide every client-shaped part of the UI at all?
232
265
233
266
That led us to create something entirely new: **Composite Components**.
234
267
235
-
`use client` still matters when the server intentionally wants to render a client component. Composite Components are for the opposite case. The server can leave join points for client UI without needing to know what goes there.
268
+
`use client` still works the same way in TanStack Start when the server intentionally wants to render a client component. `use server` does not. Start uses explicit [Server Functions](/start/latest/docs/framework/react/guide/server-functions) instead.
269
+
270
+
Composite Components are not a replacement for `use client`. They solve a similar composition problem from the opposite direction. Instead of the server deciding which client component renders where, the server can leave join points open and let the client own the tree and decide what fills them.
236
271
237
-
That is the part that feels genuinely new to us. Most RSC systems let the server decide where client components render. Composite Components let the server leave that decision open.
0 commit comments