diff --git a/packages/react-instantsearch-core/src/core/__tests__/createInstantSearch.js b/packages/react-instantsearch-core/src/core/__tests__/createInstantSearch.js index af60584127..3126c9e4c0 100644 --- a/packages/react-instantsearch-core/src/core/__tests__/createInstantSearch.js +++ b/packages/react-instantsearch-core/src/core/__tests__/createInstantSearch.js @@ -40,7 +40,10 @@ describe('createInstantSearch', () => { shallow(); expect(algoliaClientFactory).toHaveBeenCalledTimes(1); - expect(algoliaClientFactory).toHaveBeenCalledWith('app', 'key'); + expect(algoliaClientFactory).toHaveBeenCalledWith('app', 'key', { + _useRequestCache: true, + }); + expect(algoliaClient.addAlgoliaAgent).toHaveBeenCalledTimes(1); expect(algoliaClient.addAlgoliaAgent).toHaveBeenCalledWith( `react-instantsearch ${version}` diff --git a/packages/react-instantsearch-core/src/core/createInstantSearch.js b/packages/react-instantsearch-core/src/core/createInstantSearch.js index d66856cf4a..7d50c84b7a 100644 --- a/packages/react-instantsearch-core/src/core/createInstantSearch.js +++ b/packages/react-instantsearch-core/src/core/createInstantSearch.js @@ -61,7 +61,9 @@ export default function createInstantSearch(defaultAlgoliaClient, root) { this.client = this.props.searchClient || this.props.algoliaClient || - defaultAlgoliaClient(this.props.appId, this.props.apiKey); + defaultAlgoliaClient(this.props.appId, this.props.apiKey, { + _useRequestCache: true, + }); if (typeof this.client.addAlgoliaAgent === 'function') { this.client.addAlgoliaAgent(`react-instantsearch ${version}`);