TL:DR Does Fastly work in China? Yes, Fastly does work in China, but not how you’d expect it to. While it is somewhat accessible in China, Fastly websites struggle with speed, compatibility, and delivery. Read more below.
Fastly is a U.S. content delivery network specialising in edge computing. The company highlights specific features as differentiators from their competitors including reverse proxying and instant purging.
CDNs perform a variety of functions. The primary function behind why websites use a CDN is with respect to accelerating the "delivery of content" and its benefits can be broken down into speed and security.
Content delivery networks are a distributed series of servers that store cacheable content closer to the visitor who is trying to access it.
The combination of a U.S. server with North American CDNs would generally be great for website performance within that geographic region, but not good for further areas such as China.
What is cacheable content? Cacheable content (such as images, videos, or webpages) is 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 into primary and third-party resources. It is important to note that CDNs do not accelerate access to third-party resources, leading to potentially slowing down or hindering the website loading.
Developers use CDNs in China to accelerate regional delivery for their static files i.e. delivering primary resources closer to users in China (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 here.
As Fastly sites are not inaccessible in China, but they
- Lack POPs in China, instead relying on rim CDNs.
- Do not provide China compatibility solutions to handle, resolve, or replace resources that are blocked or inaccessible from China.
To lay the groundwork, let’s define what it means for a website to work in China in terms of -
First is that having a CDN does not necessarily mean that content is delivered faster nor that it is hosted within China, thus affecting your website speed.
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 China’s unique and specific internet landscape.
CDNs with POPs inside China might help in this respect to a certain 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 performs in China.
The second issue that arises for websites working in China comes from code-based incompatibilities on the website itself.
These incompatibilities arise from the variety and multitude of technologies that are blocked or slow to load in China.
These resources include 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 blocked third-party resources 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)
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 on to the next resource. As a result, the loading process gets '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 does not 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 and at times takes upwards of 30 seconds, affecting the Deliverability of the website.
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.
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.
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, 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 such as Fastly 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.