I don't now how to config cache #4736
Answered
by
EskiMojo14
thuc201995
asked this question in
Q&A
-
I have the redux toolkit query like this
And this is my test
The result always calls the getRole API, why doesn't it get from cache? |
Beta Was this translation helpful? Give feedback.
Answered by
EskiMojo14
Nov 28, 2024
Replies: 1 comment 1 reply
-
RTKQ isn't a normalized cache, it caches by endpoint name and arguments provided. It has no knowledge that a part of your getPosts response is also the right response for getPost("foo"). |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
thuc201995
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
RTKQ isn't a normalized cache, it caches by endpoint name and arguments provided. It has no knowledge that a part of your getPosts response is also the right response for getPost("foo").