In this article, we will explore what is a content delivery network (CDN), why CDNs are used, why are CDNs used for China, top CDN providers, and common challenges developers face solely relying on a CDN to improve how their website loads from China.
CDNs perform a variety of functions. The primary function behind why websites use a CDN is with respect to accelerating the "delivery of content".
Content delivery networks are a distributed series of servers that store cacheable content closer to the visitor who is trying to access.
What is cacheable content? Cacheable content (such as images, videos, or webpages) are stored in servers located closer to end users than origin servers. Most websites contain a combination of static, cacheable content and dynamic content.
This content can further be broken down by primary and third party resources which can slow down or hinder the website loading. CDNs do not accelerate access to third party resources as well- but more on that later.
When you load a webpage, or watch a video, that file is stored somewhere on the 'Internet.'
What does that mean?
There are two key aspects to speed: Latency, and Throughput.
Let's say you're a US-based company, and your server is based in San Francisco. If your visitors are browsing your site from say Europe or Australia, it takes a long time to load the page. The physical distance data needs to cover is 8,948kms to Europe, and 11,940kms to Sydney. For data to cover that distance, it takes 149 milliseconds (ms) to Europe, and 151ms to Sydney - this is called Latency, that is, the time it takes a small piece of data to from Point A to Point B, and back. The second aspect of speed is Throughput or Bandwidth - that is, how much data can transfer from Point A, to Point B in one second. If a 1MB file takes 2 seconds, and you have 10 images, then 20 seconds won't cut it for a consumer experience.
As mentioned above, each web site consists of a number of components or 'Resources' - typically about ~100 of them, although some sites have upwards of 300. While 150ms isn't that long of a time to wait for one resource, when you're loading 300 resources, this time starts to add up. Even worse, in China, latency is sometimes upwards closer to 1 full second!
What CDNs do is place that specific file much closer to you by storing it on nodes or servers all around the world (note: these servers are often called POPs which stand for Point of Presence).
If that file is hosted with a company called Akamai (the largest CDN), it's likely that file may literally be on a server hosted next door (they have over 175,000 locations globally). This way, you don't need to go 'across the world' to retrieve that webpage, you can literally just load it from 'across the street'. Generally, when a CDN Node or Server is closer to you, the Latency is lower (i.e. faster), and Throughput is Higher (i.e. faster).
Another important element to CDNs nowadays is security, where CDNs are the "first line of defence" for many sites offering Web Application Firewalls (WAF) and Distributed Denial of Service (DDOS) protection - this isn't as relevant here though. We really just wanted to add these monsters/ghouls into the graphic below.
Developers use CDNs in China to accelerate regional delivery for their static files (i.e. images or files hosted on their website).
In spite of their limitations in solving all of the common issues arising from loading websites in China, a well-selected CDN is still helpful in resolving some portions of website performance issues that websites face.
More about China CDN comparisons and considerations can be read about here.
Disclaimer: The CDNs and the entities mentioned below are popular global CDN services. The China entity names may vary, or not exist at all. The purpose of this list is to provide a scope of the prevailing services and to illustrate this against usage in China.
Akamai Global vs. Akamai China
Akamai Technologies, Inc. is a global content delivery network (CDN), cybersecurity, & cloud service company providing web and Internet security services. Akamai's Intelligent Edge Platform is one of the world's largest distributed computing platforms and used primarily by Enterprises.
Akamai does not operate its own CDN or points-of-presence (i.e. POPs) in China. Instead they partner with ChinaNetCenter, and leverage their onshore PoPs.
Akamai China CDN is an add-on module to Akamai’s base-delivery products such as Ion.
ChinaNetCenter is also known as Wangsu Technology Company Limited, which is functionally a third-party service that is logically separated from Akamai's global operations (for many reasons).
Wangsu has 500+ PoPs in China and provides largely the typical CDN services one would expect from a content delivery network. However, Akamai global CDN features such as image optimisation and DNS are not available for Akamai China. akamai
This is similar to Cloudflare's China CDN, and their partnership with Baidu.
Prerequisites to use Akamai China CDN include an ICP Filing or License, local hosting agreement with Chinese-based hosting provider, PSB Bei An, a legal entity in China/China-owned business or a China-based representation office. Companies remain the exclusive owner of customer data but data must be stored domestically in China.
Fastly CDN (Global-Only)
Fastly is an American content delivery network specialising in edge computing. The company highlights specific features as differentiators from their competitors including reverse proxying and instant purging.
High profile examples include the Shopify platform, which uses both Fastly and Cloudflare to power their sites.
Fastly customers with origins outside of China may experience up to 50-70% latency for their end-viewers in China versus customers using Chinafy either in combination with rim delivery leveraging the Fastly global network or Chinafy’s de facto CDN stack leveraging several providers.
Fastly CDN (Onshore) in China
Fastly does not have any Points of Presence (PoPs) in China. They have seven rim PoPs near-China in Asia as of 2021.
Cloudflare Global CDN vs. Cloudflare China CDN
Cloudflare is an infrastructure and web security company that provides content delivery network (CDN) and DDoS mitigation services. It is based in the U.S, with its headquarters in San Francisco, California.
Cloudflare does not operate its own CDN or points-of-presence (i.e. POPs) in China. Instead they partner with Baidu and JD Cloud, and leverage their onshore PoPs.
Prerequisites to use Cloudflare China CDN include an ICP Filing or License, local hosting agreement with Chinese-based hosting provider, PSB Bei An, a legal entity in China/China-owned business or a China-based representation office. Companies remain the exclusive owner of customer data but data must be stored domestically in China.*
*Cloudflare China CDN starts at US$4-5K/month, referenced from 2021 onwards.
AWS Cloudfront Global vs. AWS Cloudfront China
Amazon CloudFront is a content delivery (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency, high transfer speeds, all within a developer-friendly environment.
Operated by Amazon Web Services (AWS), this CDN provides a globally-distributed network of proxy servers that cache content closer to end visitors, thus improving access speed for downloading the content. They also provide other services including Real-time Metrics, Security against Network and Application layer attacks and more.
CloudFront does not operate its own CDN or points-of-presence (i.e. POPs) in China. Instead, CloudFront China has three Points-of-Presence (PoPs) that are separated from the rest of their global network. AWS China (Beijing) is operated by Ningxia Western Cloud Data Co. Ltd. (NWCD) & AWS China (Ningxia) is operated by Sinnet respectively.
To use CloudFront China, customers need to obtain these prerequisites including: an ICP Filing or License, local hosting agreement with Chinese-based hosting provider, PSB Bei An, a legal entity in China/China-owned business or a China-based representation office. Companies remain the exclusive owner of customer data but data must be stored domestically in China.
Learn more about how Chinafy helps achieve near-native onshore performance, offshore without a separate site, ICP license or onshore hosting for Amazon CloudFront China CDN.
Microsoft Azure Global vs. Microsoft Azure China
Microsoft Azure is a cloud-based content delivery network service that enables customers to securely and reliably access their applications globally. It is designed to improve the performance, scalability, and security of web applications.
Azure Front Door users take advantage of over 100 edge locations for low-latency, high-throughput application delivery globally.
As of 2023, Azure Front Door does not provide points of presence in Mainland China. Like any other CDN service in nature, Azure Front Door also does not resolve code-based incompatibility in China.
As a result, visitors accessing a website using Microsoft Azure Front Door will encounter interaction and accessibility issues in China. Provided that Microsoft Azure Front Door remains accessible - albeit non-performant - a China-specialized 3rd-party resource optimisation tool like Chinafy may be used to optimize the Microsoft Azure Front Door for improved performance in China.
Chinafy and Microsoft Azure are tech partners. To learn more about how to use Chinafy & Microsoft Azure solutions together, please email email@example.com
What don’t CDNs do?
In spite of the gain from accelerating regional delivery, CDNs often still fail to deliver in two key areas when it comes to China.
First is that having a "Global Content Delivery Network" does not necessarily mean that content is hosted within China.
Due to the requirements to have your site and content hosted within China, the result is that users in China are retrieving files from CDN nodes generally outside of China - often from nodes much farther away than the optimal CDN range. This is especially true given the China internet’s specific limitations.
CDNs with PoPs inside China might help to some extent. However, while primary resources and static files that can be cached by CDNs might experience acceleration, there are elements that CDNs and hosting providers don’t touch that still can cause issues with how your website works in China.
What are code-based incompatibilities in China?
These arise from the variety and multitude of technologies that are blocked or slow to load in China.
This includes essential libraries widely used by developers globally, popular plugins, and or default components that website building platforms inherently include out of the box.
Most modern day websites are made up of hundreds of these resources.
Examples of third-party resources that are blocked include Google APIs, Vimeo, Youtube, Facebook, and more. Other primary and or third party resources*, while not blocked or inaccessible in China - may be delivered from networks that perform slowly in China (i.e. Amazon S3).
Defining Primary vs. Third-Party Resources: Primary resources are defined as web resources hosted on the primary website domain (www.website.com) vs. third-party resources which are hosted and managed by third party providers (e.g. assets.webcms.com, apis.google.com)
What happens when the browser attempts to load blocked or slow technologies from China?
First, a little background on how websites generally load -
A Request is made for HTML document
The web server provides HTML to a web browser to read
The web browser reads HTML files to identify where to find resources
Browser requests resources - including images, CSS, and js files - from the server(s)
The browser parses these files
Finally, the browser then renders (or displays) the webpage
When a browser attempts to load a blocked resource, the web browser will keep trying to retrieve the file for a period of time before it moves onto the next resource. As a result, the loading process get's 'stuck'.
So, not only does that blocked resource
i) interfere with the total loading time of the website in China, but also
ii) impacts the functionality of a site when, after multiple attempts, the site or parts of its content doesn't load at all.
Below is an example of a waterfall chart when a China visitor attempted to load resources past Facebook trackers.
Note that by 35 seconds, only 30% of this website's resources have successfully loaded.
You end up with a site that loads both partially and slowly, at times taking upwards of 30 seconds
For this reason, Tier 1 Cloud Platforms’ CDN providers partner with Chinafy to achieve full optimization on the FE application layer. Our partners include AWS, Azure and BaishanCloud.
Chinafy is a highly tuned complex integration of both Software (i.e. Code) and Infrastructure (i.e. Hardware) that can be bolted onto almost any site and will work with your existing CDNs.
By combining intelligent China-specific resource optimizations with a multi-load-balanced infrastructure, websites are able to achieve significant improvements in performance across the board.
Chinafy first scans your website to create a Chinafy-managed version of your site, detecting resources that are blocked or slow across your site.
Chinafy then optimizes that Chinafy version of your site across infrastructure, resources, and security based on best practices.
Once the Chinafy site is turned on, when visitors go to your website - your China visitors will get directed to the 'Chinafy-version' of your website and all others to the original version of your site.
Chinafy's automation rules then keep the two versions of your site in sync, optimizing your website as it evolves. By combining our Web Compatibility suite with our partnered CDN providers, Chinafy sites are 30-40% faster than sites with near-China CDNs alone.
This way, Chinafy provides the best of both worlds, ensuring that your global web experience for your global visitor remains unaffected while delivering a version of your site that works well for visitors in China.
Contact us to learn about how Chinafy helps get sites 30-40% faster than just using a CDN.