xebia-functional/fetch

Support marking fetches as not to be served from cache

purrgrammer opened this issue · 3 comments

Support marking fetches as not to be served from cache

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.

@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 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.