In the previous article of this series, we described how NGINX and Varnish can improve the speed of your website. However, we also acknowledged that to perform better in China’s digital environment, you will need to prepare and manage your website differently in order for it to perform efficiently. In this article, we will discuss two ways on how to drastically improve website performance in China: local hosting and a CDN.
The basics - how does data travel?
It is common knowledge that having your website hosted in China can help you a long way in achieving faster speed for your website, but how exactly? Before learning how a local domain and hosting can be beneficial to your website performance, let’s quickly review the nature of a website and how data travels.
A website is ultimately a set of data that travels a long distance from the hops (or hosting machine) to the client at a very fast speed. In the process, the data is routed through numerous intermediate hops between the host and the client. These intermediate hops are one of the major factors of latency when it comes to the response time of a website. It is important to note that the distance between the users and the location of the hops also greatly influences the speed of your website. In other words, the shorter the distance between the host and its users, the fewer the intermediate hops and the faster the speed of your website.
Why do I need Chinese hosting?
Now let’s dive deeper into the benefits of having your website hosted within Mainland China. First of all, when a website is hosted locally, it automatically reduces the time spent on domain name lookups (which is how we call the process of sending a request to the DNS) since the server will be based in China. Although domain name lookups generally do not take a long time, a few milliseconds saved in the process can be instrumental in providing a better experience for your customers. With the hosting machine located in China, the data lookup time is also reduced due to a lesser amount of redirections being required to fetch a website.
In addition to reduced response time and the aforementioned short distance between you and your users, another benefit of using a Chinese hosting server is the ability to reside within China’s Internet firewall. China often blocks hosts located outside of mainland China from serving contents deemed illegal according to local regulations, and prevent local users from accessing these sites. Unlike sites hosted abroad, having your website based in China eliminates the possibility of being blocked, provided that you comply with the local regulations.
The last reason to consider local hosting is especially beneficial for those hosting outside of China using a shared hosting service. Shared hosting service is a service used by multiple websites with different owners. The drawbacks of these shared solutions are that if one gets blocked it is likely that the IP will be blocked, affecting your website as well. Hosting in China would avoid this problem.
(In the alternative, you could still use a dedicated, personal hosting machine located outside China for your business - but be prepared for the latency)
Ultimately, faster speed time and decreased risk of being blocked in Mainland China are two of the major reasons why hosting your website within Mainland China will be tremendously beneficial to your business.
So, that sounds pretty straightforward, right? Just host the website in China and you’ll be fine! Sadly, hosting in China is not as simple of a task as one may like to assume. In fact, in order to have your website hosted in China, you will need to follow a few steps. Let’s learn about them.
How to have your website hosted in China?
As mentioned before, hosting a website in China is not an easy feat. To begin, one of the most common roadblocks in getting a China-based hosting service is obtaining a Chinese Internet Content Provider (ICP) license.
The Internet Content Provider (ICP) license is a state-issued registration number that is mandatory in order to host web content in Mainland China. Every website that goes live in China needs to obtain the ICP and show it in its footer (an example of ICP in the image below). An ICP number usually starts with a number indicating the issuing province, followed by the letters “ICP” and a few digits that indicate a unique registration ID.
ICP License indication at the footer of Youku.com
The main benefits of getting an ICP License are:
- An ICP License is a “passport” that guarantees your online visibility in China. Many third-party services such as Baidu PPC (the equivalent of Google Adwords) requires you to have a valid ICP Licence (we have found claims online stating that it is possible to run Baidu PPC without an ICP, but the official website says otherwise). Therefore, if you wish to operate your business in Mainland China to reach a broader Chinese customer base, obtaining an ICP license will offer your business many useful benefits:
- You will be able to host your website in Mainland China while enjoying better site performance
- You will be able to use APIs in a Mini Program
- You will be able to use a local CDN (more about CDNs in the second part of this article)
Do I need an ICP?
This is an important question for those who are seeking to build visibility of their website in hopes of reaching more Chinese customers. While it is mandatory in order to have your website hosted in Mainland China, it is not required to have an ICP license to simply display your website on the Chinese Internet. It is possible to host your sites in China special regions, such as Hong Kong or Macau, without obtaining an ICP license. This allows the Chinese users to access your website with less restriction compared to faraway hosted websites. However, your website will suffer from performance issues.
In terms of SEO, Baidu has never mentioned ICP licenses in SEO publications as a ranking factor, so there's no guarantee to know if having an ICP license makes an impact. Saying that having an ICP is a ranking factor would be mostly speculation at the moment. However, we do know that your website will be tracked by the local search engines as long as it is fully accessible to the local networks. However, for business owners who hope to achieve better performance by hosting their site in Mainland China, getting an ICP is inevitable. An ICP license would be the first demand by hosting companies before they allow you to buy a hosting account.
(Bonus: To obtain more info about getting an ICP, we strongly suggest to read this guide by Aliyun, which covers all you need to know about obtaining one.)
Where to host my site in China?
After sharing the numerous benefits of hosting in China, we cannot leave you hanging without providing some tips on how to select the most suitable solution for your business. If you do choose to host your website locally, you are in luck - there are multiple solutions that can fit any needs. Three of the most used solutions are Aliyun (Alibaba Cloud), Tencent Cloud, and AWS China. While all these three providers do a great job, we are strong supporters of Aliyun. It is our favorite choice when it comes to hosting in China due to their wide range of services available.
2. Content Delivery Network (CDN)
What is a CDN?
Besides local hosting, leveraging Content Delivery Network (CDN) is another good practice that will help enhance your website speed. A regular hosting service (no matter the location) does not guarantee excellent speed for your website. Large-sized contents, such as images, videos, and downloadable files require far greater bandwidth and large storage to serve the files effectively and efficiently. Content delivery network (CDN) is the solution to enhancing the speed of your website.
CDNs store your content on high-speed devices and serve it from a server that is physically closest to the visitors of your website. Today, nearly every high-bandwidth content gets delivered through CDNs. This growing usage of CDNs is the result of its ability to distribute contents across the world while maintaining a high delivery speed. Thus, numerous third-party libraries and scripts are now hosted on CDNs to provide better website performance.
Is a CDN necessary for China?
If you decide not to locally host your website in China, then a CDN is the alternative solution for you to improve website speed. With a CDN, you can improve your user experience in terms of speed by serving the majority of your large web contents, such as images and long scripts, via the content delivery network. After all, speed is one of the major deciding factors between a successful website and a mediocre one. By using a Mainland China CDN for a website hosted in a foreign country, the loading speed can be substantially enhanced for your local visitors. Additionally, the cost of using CDNs may be lower than serving your resources through a regular server.
In fact, we would still recommend using a CDN even if you do host in China since CDN works so well at improving your website’s performance - we will share more on this topic in a later paragraph. Whether you decide to use a CDN or not, it is important to know that to have a CDN within Mainland China also requires you to have an ICP license. So before you start investing time and resources into looking for your future CDN providers in China, make sure you can obtain an ICP first.
Which CDN should you choose?
CDN is a complex entity that has many factors to consider when choosing the most suitable CDN for your business. Some of these factors include:
- Number of nodes
- ISPs relationships
- New technology supports (HTTP/2, on the fly compression etc.)
We will not go into the details of how to select the best CDN providers in China (that may be the topic of a standalone blog post). However, we will share that based on our experience, the three best providers are the following:
Some issues with CDNs and how to fix them
While CDN offers a great solution to businesses that prefer to host outside China, they are not without drawbacks. It is important to realize some of the limitations of CDN in order to understand how to successfully host and deliver a website to users in China.
The first limitation concerns API filtering. With China’s Great Firewall filtering out or slowing down numerous popular APIs and networks such as Google CDN, Facebook or Twitter APIs, and Google Analytics APIs, it completely changes the way you manage your web content. In order to ensure that none of your plugins or APIs are relying on blocked networks for execution, you are limited to utilizing the services offered by local providers. Thus, the solution is to source the scripts or resources from a non-blocked CDN available in Mainland China or to use JSDelivr which has nodes in China too.
The second complaint that is commonly raised regarding the performance of local CDN is speed. This is usually related to the fact that a CDN targeting Mainland China will have a slower access from outside its borders. Also, during low user traffic, using a CDN does not improve performances. Therefore, is important to understand that using a CDN is not a silver bullet to solve all the performance problems of a website, and its efficiency is related to the architecture of the website itself and the way it is developed.
Hosting in China vs CDN - which is the best solution?
Both solutions can help businesses improve their website’s speed in China - one solution does not exclude the other. In fact, they actually complement each other. We have selected 3 scenarios to help you make a better decision, based on the amount of traffic your website experiences.
- For websites with large traffic, it is advisable to have both your Web Servers (serving dynamic content) and your CDN (serving static content) located as closely as possible to your users. This means that if your target audience is located within Mainland China, using local hosting and CDN at the same time is advised.
- For websites with medium traffic, it is still advisable to have the same configuration as above (Local hosting + CDN), but it is important to consider the cost of this venture. If the business objectives set by your company meet the cost of operating this kind of setup, then we say go for it.
- For websites with low traffic, a CDN may not be necessary, so only hosting in China will be enough.
In any case, it is important to remember that both having a Web Server or a CDN within Mainland China requires an ICP - so the first thing to do would be to check whether you are eligible to obtain one.
The number of foreign businesses entering the Chinese market is only expected to grow in the next decade, it will be extremely important for this business to understand how to compete in China’s digital landscape. Local hosting and CDN are two good practices that allow your website to achieve higher speed in China, and it should be definitely be considered by any company that hopes to reach a wider audience in China. As the internet grows to become one of the most profitable platforms for connecting and engaging with your audience, understanding how to craft a substantial website in China will definitely make your business’s transition into the Chinese market smoother.
That was it for today! In the next part, we will analyze the best practices when developing a website for China to improve speed - stay tuned!
About the author
COO and Co-founder of IT Consultis
As the COO of ITC, Thomas manages all the operations and promotes the adoption of new technologies and philosophies within the company. In addition to raising the efficiency of each project, he invests his time in coaching and mentoring the project management as well as the development team, ensuring they all have standardized knowledge and skills to successfully meet the clients’ expectation.