Skip to content

fix: skipped SSR cache usage & precached data return#1604

Open
fabis94 wants to merge 2 commits intovuejs:v4from
specklesystems:fabians/remove-ssr-forced-fetch-policy
Open

fix: skipped SSR cache usage & precached data return#1604
fabis94 wants to merge 2 commits intovuejs:v4from
specklesystems:fabians/remove-ssr-forced-fetch-policy

Conversation

@fabis94
Copy link
Contributor

@fabis94 fabis94 commented Feb 27, 2026

Two bugs:

  • In SSR the fetchPolicy is always forced to be network-only? This makes no sense - what if you invoke the same exact operation from multiple places in the app? network-only is gonna skip cache and re-do the same exact request multiple times. Definitely not good, kinda crazy that this has been in the lib for so long.
  • In SSR, waiting for results relies on onServerPrefetch, which is OK enough, but not enough for non-component use cases (e.g. Nuxt plugins/middlewares). Instead of just relying on onServerPrefetch, I made it also re-use the same logic CSR uses where if there's cached data already, it returns it immediately.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 27, 2026

Open in StackBlitz

@vue/apollo-components

npm i https://pkg.pr.new/@vue/apollo-components@1604

@vue/apollo-composable

npm i https://pkg.pr.new/@vue/apollo-composable@1604

@vue/apollo-option

npm i https://pkg.pr.new/@vue/apollo-option@1604

@vue/apollo-ssr

npm i https://pkg.pr.new/@vue/apollo-ssr@1604

@vue/apollo-util

npm i https://pkg.pr.new/@vue/apollo-util@1604

commit: 148d337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant