Cached local storage query persist
i never watch to refetch within a particular session and i only want to fetch upon page load, but also not more often than X hours. if i just visit the page for the first time, it should fetch. but then if i refresh the page a minute later, it should not refetch and just load from cache instead. if i wait say 12 hours and refresh, then it should fetch again and update the local storage.
I have the following basic code and the above functionality is not working. The issue is that it refetches upon page load every time.
my understanding is that the config i pass to QueryClient default options prevents all reloading during a session, and the persistOptions passed to PersistQueryClientProvider should ensure that it loads from cache until maxAge has passed upon which itll refetch from the API. What am i missing here?