How to improve coveo resources load performance?
Hi, we are using coveo cloud for our search solution, in order to use coveo search box or search view component, we have to add the resources related to it, which has large size files and takes lot of time to load it. It is significantly reducing the performance our website. i have uploaded the screen shot of load in network from chrome developer tool.
Is there any way to bundle everything and reduce the file size in order to improve the performance and load it async like require?
As Martin mentions, you only need the "Coveo Search Resources" component which loads `CoveoJsSearch.WithDependencies.min.js`. Here you are also loading 2 additional JS files:
Those files are from the "Coveo Search Box Resources" component. This component is not needed if you are already using the "Coveo Search Resources" component. You will remove almost half of the loaded file size by removing it.
I think your are loading too many redundant files here:
CoveoJsSearch.WithDependencies.min.js already embeds CoveoJsSearch.Dependencies.min.js (hence the name), so you don't need the 2nd one.
Also, for a page where you only need the search box, you should only load CoveoJsSearch.SearchBox.min.js which only contains the required stuff, vs the larger CoveoJsSearch.WithDependencies.min.js. And on a search page, you don't need the CoveoJsSearch.SearchBox.min.js file.
Finally, please ensure that the files are served with GZip compression; not sure if it's the case here.