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

Support marking fetches as not to be served from cache #183

Closed
purrgrammer opened this issue Mar 6, 2019 · 3 comments
Closed

Support marking fetches as not to be served from cache #183

purrgrammer opened this issue Mar 6, 2019 · 3 comments

Comments

@purrgrammer
Copy link
Contributor

No description provided.

@purrgrammer purrgrammer changed the title Support marking fetches as not cacheable Support marking fetches as not to be served from cache Mar 6, 2019
@purrgrammer
Copy link
Contributor Author

I've been working on a WIP branch for implementing this, but I've found a few cases that cause problems:

  • What happens if the same identity is marked as "uncached" and then combined with a fetch that contains the same identity but not marked as "uncached"? Should it be looked up in the cache or not? This ambiguity cannot be catched by the compiler.
  • Even though "uncached" values are not served from the cache, should the cache be updated after they have been fetched? Note that there can be a value in the cache that is different from the one we get when fetching.

After thinking about it I don't think this fits with the Fetch execution model and is best implemented with a custom cache in userland that discriminates the 'Data' instances that you don't want cached. It should be relatively easy to do, happy to provide guidance.

@nomisRev
Copy link

@purrgrammer is this something we need to include in the docs? And perhaps even elaborate with a basic snippet on how to do this in userland?

@purrgrammer
Copy link
Contributor Author

@purrgrammer is this something we need to include in the docs?

I'm going to write a list of "Use fetch if" and "Don't use fetch if" in the docs to clarify what the library is suited for. Good point!

And perhaps even elaborate with a basic snippet on how to do this in userland?

Sure, I'll write an example and submit a PR.

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

No branches or pull requests

2 participants