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

[Store / Cache] The key from cacheOptions is not used #8516

Closed
Jopie01 opened this issue Mar 29, 2023 · 0 comments · Fixed by #8517
Closed

[Store / Cache] The key from cacheOptions is not used #8516

Jopie01 opened this issue Mar 29, 2023 · 0 comments · Fixed by #8517
Labels
🏷️ bug This PR primarily fixes a reported issue

Comments

@Jopie01
Copy link

Jopie01 commented Mar 29, 2023

When I fetch data from my JSON-RPC backend, the url is not changing but stays the same. This will basically kill caching because the key used for caching is the url. So the latest response overrides the rest.
Thankfully there is an option to add my own key to the cacheOptions however this key is never used. Even the code seems to have some checks for it, the key is never used.

My first impression was

const lid = cacheOptions?.key || (method === 'GET' && url) ? url : null;
because there the cacheOptions.key isn't picked up. When I force it, further down the stream the key is changed back to the url.

But as said in #8507 (comment) there are a few things in the way which have to be fixed. This is a reminder 🎗️ .

BTW, the key I generate is based on the method and params. Both together create a unique string from which I create a MD5 hash. That's the key I also send to the backend to uniquely identify the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bug This PR primarily fixes a reported issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants