@algolia/cache-common not working along with React InstantSearch + Next.js #6221
Replies: 1 comment 1 reply
-
Do you have this experience in a reproducible sandbox or similar? I'm not sure how the cache can impact the routing |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to integrate query request caching into my Nest.js application by referencing: https://www.algolia.com/doc/api-client/getting-started/customize/javascript/?client=javascript#caching-requests-and-responses.
I set a search client with the Algoliasearch package with my Aloglia app ID and search API key. And also supply a response cache params for it. Then, provide it to React InstantSearch for use:
After setting it, it makes a cache response to a browser localStorage within the timeToLive duration. However, when I type in a URL with facet params that worked before (mapping the route to state), the route to state does not work. It will remove all the facet params, e.g. I have a url with facet param,?onsale=20%3A100. After going to the page, the param will be removed if it is within a cache duration (a prefetch is fine).
Also, I tried to cache the request,
Is there any way to fix it? Thanks.
packages version:
Beta Was this translation helpful? Give feedback.
All reactions