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
While using apollo-cache-persist, the cache is successfully persisting across page refreshes, but it's not preventing unnecessary network requests as expected.
First query after page refresh: network request + cache
Subsequent identical queries: cache-only, no network request
Actual Behavior
Every query results in a network request, even when querying the same endpoint with identical variables, regardless of whether it's the first or subsequent call.
I'm defining the same query in two different components, and when also the second component renders, the network call is performed, while I expect the second call to go under nextFetchPolicy (so cache-first).
Environment
apollo-cache-persist version: 0.15.0
Apollo Client version: 3.12.2
React version: 18.2.0
Additional Context
The cache appears to persist correctly, but Apollo Client isn't utilizing it to prevent network requests. This occurs even when the same query is executed in different components.
Any insights on how to configure apollo-cache-persist to achieve the expected caching behavior would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Description
While using apollo-cache-persist, the cache is successfully persisting across page refreshes, but it's not preventing unnecessary network requests as expected.
This is how I set up the client
Expected Behavior
Actual Behavior
Every query results in a network request, even when querying the same endpoint with identical variables, regardless of whether it's the first or subsequent call.
I'm defining the same query in two different components, and when also the second component renders, the network call is performed, while I expect the second call to go under
nextFetchPolicy
(socache-first
).Environment
Additional Context
The cache appears to persist correctly, but Apollo Client isn't utilizing it to prevent network requests. This occurs even when the same query is executed in different components.
Any insights on how to configure apollo-cache-persist to achieve the expected caching behavior would be greatly appreciated.
The text was updated successfully, but these errors were encountered: