Tags: Episerver Find Søk

Episerver Find and The Great Wall of China

When running Episerver CMS in the cloud, Episerver Find has become the de facto standard. Find is a highly scalable, multi-lingual, full-featured and easy to use solution that optimizes customer experience​, built natively for Episerver.

Our new kick ass website should of course be available in China, the world’s biggest consumer market. Luckily Episerver let us create search indexes with support for different languages, including Chinese. Stemming will be handled correctly when searching for Chinese content. Perfect.

Configuring a Find index, with Chinese language

The Problem

Post-launch we notice that traffic from China is not quite as we expected. After some investigating, the tools at dotcom-tools.com indicate that our blazing fast website takes 50+ seconds to load in mainland China. And why is the site so slow? Because of a 2 KB JavaScript file that can’t be loaded from https://dl.episerver.net/13.0.5/epi-util/find.js

A waterfall diagram showing that find.js loads very, very slow

Find.js is Episerver Find’s tracking script that stores statistical data about search queries submitted by site visitors, and the results that they clicked. The collected statistics can be analyzed, providing administrators with deeper insight into the search’s efficiency.

The Great Wall of China is well known as one of the seven wonders of the world, the digital equivalent is The Great Firewall of China that protects the Chinese population against threats such as Facebook, Google, Instagram, YouTube and Episerver Find’s tracking script.

Result from the China Firewall Test:

A tool that show dl.episerver.net is blocked in China

The Solution

After understanding the problem, the solution is quite easy. The Great Firewall of China blocks the domain name dl.episerver.net so if we host the find.js file on our own domain, it will work like a charm.

Just download find.js, include it in your project, and specify the path in module.config like this:

<module>
  <clientResources>
    <add name="epi.find.trackingScript" path="Scripts/find.js" resourceType="Script"/>
  </clientResources>  
</module>

Unless the specified path starts with a slash (/), it refers to a file below /ClientResources/ like this:

Show the palcement of find.sj in the folder Scripts below ClientResources

After moving the file to our own domain, the JavaScript file is loaded in China and the website is usable.

P.S. Remember to update find.js when updating Episerver Find!