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

Caching #189

Open
yonaskolb opened this issue Dec 6, 2023 · 2 comments
Open

Caching #189

yonaskolb opened this issue Dec 6, 2023 · 2 comments

Comments

@yonaskolb
Copy link
Contributor

Is Caching via the CachExchange supposed to be working? It seems it's not.
Looking into the code, the caching uses Operation.id as a key, but that id is a random UUID every time a query is created by the client.
The tests around CacheExchange always use stable id's which is why the tests pass.

Are my assumptions correct and would some changes need to be made to get caching working, or am I holding it wrong in some way?

@pokryfka
Copy link
Contributor

pokryfka commented Dec 6, 2023

(Reacting with thumb up as it never worked for me as well, would be happy if it was resolved).

@shaps80
Copy link
Collaborator

shaps80 commented Dec 6, 2023

Out of curiosity why do you want this library to do any caching? Personally I prefer when a library doesn't enforce specific caching strategies unless it's a full-fledged feature with a lot more control.

Generally I prefer the library to be more predictable, i.e. every call to an API should result in the same expectation.

Caching makes this more difficult as it abstracts away 'some' details as to why (and what) is exactly returned.

I have been wondering for a while whether this is something we should even be doing tbh.

Would love to hear other perspectives on this.

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

3 participants