Overview
Cloudflare is the world's largest cdn provider. Its free plan is powerful, but access speed in mainland China has always been a pain point. Because there are no mainland nodes, free plan traffic goes through nodes in Hong Kong, Japan, or the United States, resulting in higher latency.
However, through certain configurations and third-party solutions, China access speed can be significantly improved. This article introduces several commonly used methods.
I. Default China Access Situation with Cloudflare Free Plan
The typical access route for Cloudflare Free Plan in China is: User -> Chinese carrier -> Hong Kong/Japan/Singapore Cloudflare node -> Origin server. Latency on ordinary routes is relatively high (150–250ms).
However, Cloudflare has partnerships with some Chinese carriers, and some requests may take optimized routes. But this is uncontrollable. For websites targeting Chinese users, using Cloudflare Free Plan alone may not be the best choice.
II. Optimization Method 1: Alternative to Railgun (Discontinued)
Cloudflare once offered Railgun dynamic acceleration, but it has been discontinued. Now the free plan can only start from the following methods.
III. Optimization Method 2: Custom IP Optimization
Cloudflare assigns multiple edge node IPs to each domain. Different IPs vary greatly in speed across different regions. You can use tools to screen out the fastest IP for your region (non-standard service).
Method: Use Cloudflare Partner or third-party tools to obtain CNAME access, then use speed testing tools to find the fastest IP, and manually modify hosts or DNS to point to that IP. However, be aware of compliance risks.
IV. Optimization Method 3: Cloudflare + China CDN Two-Layer Architecture (Recommended)
The most stable and compliant method: Chinese users -> China CDN (Alibaba Cloud/Tencent Cloud/Upyun) -> Cloudflare -> Origin server. The China CDN handles mainland China acceleration, while Cloudflare handles overseas access and security protection.
Configuration steps:
- Point the origin directly to Cloudflare (the origin domain is not publicly disclosed).
- In the China CDN console, point the accelerated domain to the CNAME address assigned by Cloudflare (back-to-origin to Cloudflare).
- Enable HTTPS on the China CDN, and upload the Cloudflare origin certificate or a self-signed certificate.
In this way, Chinese users go through China CDN nodes with fast speed; overseas users still go through Cloudflare. The disadvantage is increased cost (China CDN requires payment).
V. Optimization Method 4: Use Cloudflare Only for DNS and Security Protection, Disable CDN
In Cloudflare DNS settings, grey out the cloud icon for domain resolution (change Proxy status to DNS only). This way, Cloudflare only provides DNS resolution and security protection (some features) and does not proxy traffic.
Website traffic goes directly to your origin server. This is suitable when the server is located in China or Hong Kong and has a good route.
VI. Optimization Method 5: Use Cloudflare for SaaS (Hosted Access)
Cloudflare for SaaS allows you to customize the back-to-origin domain and use preferred IPs. It requires an Enterprise or paid plan. For ordinary webmasters, the cost is relatively high, so it is not recommended.
VII. Summary: Recommendations for Individual Webmasters
- Very limited budget, and website users are mainly in mainland China: Do not use Cloudflare; directly choose a China CDN (Upyun/Qiniu Cloud free quota and Alibaba Cloud/Tencent Cloud small traffic).
- Website users are globally distributed, but China accounts for a relatively high proportion: Adopt a two-layer architecture (China CDN + Cloudflare), with China going through China CDN and overseas going through CF.
- Website only targets overseas users: Cloudflare Free Plan is completely sufficient.
- Do not want to pay, but want slight optimization: You can try the preferred IP method, but stability is not guaranteed.
