Understanding how the Coveo JavaScript files are loaded (CDN)

Warning
Legacy feature

This article pertains to the Coveo Hive framework which is now in maintenance mode.

Choose one of Coveo’s more modern, lightweight, and responsive libraries for any future search interface development. See the search interface Implementation guide for more details.

The Coveo Hive framework renderings rely on the Coveo JavaScript Search Framework. That’s why Coveo for Sitecore packages include the files of a Coveo JavaScript Search Framework package. By default, these local files are installed under <SITECORE_INSTANCE_ROOT>\Coveo\Hive\. Coveo also hosts Coveo JavaScript Search Framework resources on a Content Delivery Network (CDN).

The Coveo Search Resources rendering gives you the option to reference the local files or to load the Coveo JavaScript Search Framework resources through the CDN.

The CDN removes some load from your site by requesting files located on an external server. Usually, this separation translates into more responsive search interfaces. However, using the CDN exposes you to firewall filtering or other call blocking mechanisms.

Note

The Coveo JavaScript Search Framework CDN base URL is https://static.cloud.coveo.com/searchui/<VERSION_NUMBER>. When using the Coveo JavaScript Search Framework CDN, make sure an allowlist filter matches URLs with that pattern.

Version of Coveo JavaScript Search Framework included in Coveo for Sitecore

Coveo JavaScript Search Framework releases are assigned version numbers in the MAJOR.MINOR.PATCH format (for example, 2.10099.2). The version number of the Coveo JavaScript Search Framework local files included in a Coveo for Sitecore package is mentioned at the beginning of every release note article.

Example
Framework version local files versus CDN files | Coveo JavaScript Search Framework 5

Release note articles also specify the Coveo JavaScript Search Framework MAJOR.MINOR version that Coveo for Sitecore targets when using the CDN.

Example
Framework version local files versus CDN files | Coveo JavaScript Search Framework

This MAJOR.MINOR version is the very latest MAJOR.MINOR.PATCH release of the Coveo JavaScript Search Framework. When a new patch of the Coveo JavaScript Search Framework is released, Coveo updates the CDN MAJOR.MINOR version to this patch. Therefore, if you’re using the CDN for a given search interface, that search interface automatically uses the latest patch of the MAJOR.MINOR release.

Loading Coveo Hive JavaScript resources from the CDN

You can now also load Coveo Hive JavaScript resources from the CDN. The Coveo Hive CDN base URI is https://static.cloud.coveo.com/coveoforsitecore/ui/<VERSION_NUMBER>.

Note

If you use the CDN, make sure you allowlist URLs that begin with the following pattern:

  • Coveo JavaScript Search Framework: https://static.cloud.coveo.com/searchui/<VERSION_NUMBER>

  • Coveo Hive resources: https://static.cloud.coveo.com/coveoforsitecore/ui/<VERSION_NUMBER>

Switching between the CDN and local files

  1. Open the search page in the Experience Editor.

  2. Set a data source for the Coveo Search Resources rendering. If it already has a data source, you can skip this step.

    1. Find the Coveo Search Resources rendering, which is usually located at the bottom of the page.

    2. Select the Coveo Search Resources rendering to display its floating toolbar.

    3. In the floating toolbar, select Change associated content.

      Changing associated content | Coveo for Sitecore 5
    4. In the Select the Associated Content window, select the parent item for your data source and click create.

    5. In the Insert Item window, click Coveo Search Resources, provide a name for your data source, and then click OK.

  3. With the Coveo Search Resources rendering selected, in the floating toolbar, select the Edit the rendering’s data source option.

    Editing the data source | Coveo for Sitecore 5
  4. In the data source options dialog, select whether you want to use the CDN or local files.

    1. If you want to load Coveo JavaScript Search Framework and Coveo Hive JavaScript files using the CDN, leave the Use local files for Coveo JavaScript Resources checkbox blank.

      1. To use the default version of the CDN files, leave the Coveo JavaScript Search Framework CDN Version field blank.

        Important

        Coveo for Sitecore uses the appropriate version of the CDN by default. Coveo can’t guarantee your Coveo for Sitecore version works with a more recent version of the Coveo JavaScript Search Framework than the one your Coveo for Sitecore version has been coded for and tested with.

        Using the CDN | Coveo for Sitecore 5

        To reference a more recent version of the Coveo JavaScript Search Framework, see the Coveo Search Resources data source options.

    2. To rely on Coveo JavaScript Resources local files, select Use local files for Coveo JavaScript Resources.

      1. To use the default location fo the resources (that is, /Coveo/Hive), leave the Resources local path field blank.

        Using the local files | Coveo for Sitecore 5

        Otherwise, specify the path to the resources files in the Resources local path field.