Why is the client-side requests not cached when using React Query with Hydration? #8391
-
|
https://stackblitz.com/~/github.com/vitminakov/nextjs-caching-problem https://github.com/vitminakov/nextjs-caching-problem I'm using However, when I add a header slot (see example below) and perform the same query on the client, it isn't cached. The test request is triggered three times. Is this because the What was expected: What happened: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The problem is that if you change the order: it’ll work. I think that’s expected, as the |
Beta Was this translation helpful? Give feedback.
The problem is that
headeris rendered beforechildren. That means on the client, whenheaderrenders, theHydrationBoundaryhas not yet put data in the cache.if you change the order:
it’ll work. I think that’s expected, as the
HydrationBoundaryis the one that actually sends data to the client.