SSR data is fetched again on the client with vike-vue-query #1792
-
Greetings! The repeated request sent from the client side: Am I getting something wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Indeed, the data shouldn't be re-fetched. Can you publish a reproduction? CC @nitedani |
Beta Was this translation helpful? Give feedback.
-
@brillout I have found the root cause of the issue. Turns out, this is an expected behaviour in TanStack Query, where if you use SSR - you have to set the query's stale time to a high enough value to avoid immediate refetch. |
Beta Was this translation helpful? Give feedback.
@brillout I have found the root cause of the issue. Turns out, this is an expected behaviour in TanStack Query, where if you use SSR - you have to set the query's stale time to a high enough value to avoid immediate refetch.
It was actually answered here.
So there is no issue with vike or vike-vue-query whatsoever.