Skip to content

How do you update InfiniteHits session storage cache? #5306

Answered by Haroenv
landermedia asked this question in Q&A
Discussion options

You must be logged in to vote

There's indeed no out-of-the-box solution for this yet, but the key is ais.infiniteHits in sessionStorage, so if you clear that key before doing instantsearch.refresh(), it should work as expected. Something like this should work: https://codesandbox.io/s/hardcore-tharp-zhkpoe?file=/src/App.js:749-840

Note that accessing search.refresh() requires you to import InstantSearchContext, which isn't yet exported from the root, as we haven't decided on the best way to expose it.

Note that you probably want to set the page back to zero at that point too, depending on your implementation.

Hope that helps!

Replies: 0 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@landermedia
Comment options

@Haroenv
Comment options

@landermedia
Comment options

Answer selected by landermedia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Library: React InstantSearch < 7 Issues in any of the react-instantsearch@6 packages
2 participants