#community-help

Accessing Cached Data in Typesense InstantSearch Adapter

TLDR alex asked how to access cached data in Typesense InstantSearch adapter. Jason explained the difficulty in accessing cache entries due to the cache key being a hash of request parameters.

Powered by Struct AI
6
7mo
Solved
Join the chat
Feb 21, 2023 (7 months ago)
alex
Photo of md5-0dc7ffd31fe74c8940f4a6976fc32045
alex
04:09 AM
Whenever we navigate to different pages, the data got from server gets cached in instant search. So when we visit the already visited page again, the data is not pulled from server but it gets loaded from the cache for that page. Is there any way we could access this cached data or hits?

currently using : https://github.com/typesense/typesense-instantsearch-adapter#with-react-instantsearch
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:10 AM
If you re-instantiate the instant-search-adapter on page navigation, that should clear cache
04:12
Jason
04:12 AM
Oh wait, your question is how to access the cached data…
04:13
Jason
04:13 AM
The cache key is a hash of the request parameters… so you would have to know all the request parameters to access the correct cache entry, which is not an easy thing to do
alex
Photo of md5-0dc7ffd31fe74c8940f4a6976fc32045
alex
04:40 AM
I see, thanks for the quick reply, will check them out 😄