Refresh client cache with hooks #5324
-
Hi, Using Next.js and their API routes, once I perform an index operation, I want to refresh the client cache to reflect that change directly. In the back end, I make sure to use the
Once I go back to the client side, I use the refresh method from the
I can see the new search being called in the network tab but I still get the stalled data from the Algolia index. Edit: Do I miss something here? |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 4 replies
-
That's possible that since #3554, calling For now, you could manually force an update, until we fix that in the lib. Edit: this guess was incorrect, it's because of the |
Beta Was this translation helpful? Give feedback.
That's possible that since #3554, calling
useInstantSearch()
doesn't trigger a render, and therefore doesn't refreshes the screen. We need to programmatically rerender now when callingrefresh()
.For now, you could manually force an update, until we fix that in the lib.
Edit: this guess was incorrect, it's because of the
useInfiniteHits()
which uses its own cache.