React-query data doesn't stay in cache #1382
Unanswered
GuidovdRiet
asked this question in
Q&A
Replies: 1 comment 8 replies
-
can you put that in a codesandbox and share it with us maybe, I don't quite grasp it yet :) there are a couple of things that I would probably do a bit differently, like adding |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For a migration project, I receive the entire page data as a string. This string is parsed in the
setInnerHTML()
function. Based on the switch of the location an entirely new page-data-string is fetched and inserted into the page. I run into two problems while fetching the data:When I navigate quickly from one page to another the data loaded doesn't correspond with the current location. The data loaded is still from a location that I visited 1-2 steps before.
Page data is not cached. At every switch to a new route, the page just fetches the new data. Only the data of the currently visible page is displayed in the
ReactQueryDevtools
. No other pages are stored in the cache.Beta Was this translation helpful? Give feedback.
All reactions