-
Notifications
You must be signed in to change notification settings - Fork 224
Closed
Labels
Description
Description
Our company is currently utilising a backend search as described by https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/.
Implementing this as far as I can tell means that these requests aren't cached in the client's inbuilt responseCache.
Is there any guidance/ability to hook up custom searches to the responseCache? Would something like this work? :
export const customSearchClient = {
...algoliaSearchClient,
async search<TObject>(requests: readonly MultipleQueriesQuery[]) {
const key = { requests };
return algoliaSearchClient.transporter.responsesCache.get(key, async () => {
const response: Readonly<Promise<MultipleQueriesResponse<TObject>>> = customServerRequest()
await algoliaSearchClient.transporter.responsesCache.set(key, response);
return response;
});
}
Client
Search
Version
all
Relevant log output
No response