Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unneeded persistence of network-only queries #48

Closed
mefjuu opened this issue Apr 26, 2018 · 1 comment
Closed

Unneeded persistence of network-only queries #48

mefjuu opened this issue Apr 26, 2018 · 1 comment
Labels
feature New addition or enhancement to existing solutions

Comments

@mefjuu
Copy link

mefjuu commented Apr 26, 2018

In my opinion, queries with cache policy set to 'network-only' oughtn't to be persistent.
CachePersistor seems not to respect this policy and store all the queries.

@jamesreggio
Copy link
Contributor

Hi @mefjuu

This is a limitation with how apollo-cache-inmemory is built. The cache reconstructs the results of every query every time any query is fetched, and thus it needs to temporarily cache the results of network-only queries to be able to reconstruct their results as needed.

apollo-cache-persist is fairly dumb and just dumps + restores the entire contents of the cache. Right now, there's no way to tag chunks of data within the cache with different persistence policies, but it's definitely something that the Apollo team has in mind for v3.

There's been a long discussion about cache filtering in #2, so I'm going to close this issue for now and we can continue to track it over there.

Thanks for sharing your opinion!

@jamesreggio jamesreggio added the feature New addition or enhancement to existing solutions label Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New addition or enhancement to existing solutions
Projects
None yet
Development

No branches or pull requests

2 participants