This is the post I wish I had when I started routing traffic between Europe and China years ago. I’ve written about CEN and ICP before, and Xataka even published a piece about my experience with corporate VPNs through Alibaba Cloud. But I’ve never put the full CDN and DCDN story in one place. So here it is: everything I’ve learned about making web applications actually fast for users on both sides of the Great Firewall.
The Reality of Cross-Border Latency
If you host a website in Frankfurt and a user in Shanghai loads it, the HTTP request has to traverse international undersea cables, pass through China’s border gateways, deal with TCP congestion and packet inspection, and then do the whole trip in reverse. Round-trip times of 300-500ms are normal. With TLS handshakes and multiple resource requests, a page that loads in 1 second from Europe can take 8-12 seconds from China.
This isn’t a theoretical problem. I’ve measured it for years. The Chinese internet is not slow by itself (domestic services are fast), but the cross-border path is congested by design (because of the Great Firewall, you know).
The Two Products You Need
Alibaba Cloud offers two CDN products that solve different parts of this problem:
CDN (Content Delivery Network): classic CDN for static content. Caches your assets at edge nodes across China and globally. Good for images, CSS, JS, fonts, videos.
DCDN (Dynamic Route for CDN): handles both static caching AND dynamic content acceleration. Uses Alibaba’s private backbone network to route requests between regions, bypassing the congested public internet. This is the one that makes the biggest difference for applications with dynamic APIs in my experience.
The key insight is that DCDN optimizes the network path apart of caching. Even for non-cacheable API responses, DCDN routes traffic through Alibaba’s internal network between their global PoPs, which is much much faster than the public internet for cross-border traffic.
Setting Up CDN for Static Assets
Start with the basics. If your European application serves any static content to Chinese users, CDN alone can cut load times by 60-70%.
Add Your Domain to CDN
aliyun cdn AddCdnDomain \
--DomainName cdn.yourdomain.com \
--CdnType web \
--Sources '[{"content":"your-origin.eu-central-1.aliyuncs.com","type":"oss","port":443,"priority":"20","weight":"10"}]' \
--Scope overseas
The Scope parameter matters:
overseas— CDN nodes outside mainland China only (no ICP required)domestic— mainland China CDN nodes only (ICP filing required)global— both (ICP filing required)
If you don’t have an ICP filing, start with overseas. You can still accelerate traffic for Chinese users through Hong Kong and Singapore edge nodes, which are much closer than Frankfurt.
Configure HTTPS and HTTP/2
aliyun cdn SetDomainServerCertificate \
--DomainName cdn.yourdomain.com \
--CertType cas \
--ServerCertificateStatus on
aliyun cdn BatchSetCdnDomainConfig \
--DomainNames cdn.yourdomain.com \
--Functions '[{"functionName":"https_option","functionArgs":[{"argName":"http2","argValue":"on"}]}]'
Set Cache Rules
For a typical web application, I use aggressive caching for immutable assets and short TTLs for HTML. The BatchSetCdnDomainConfig API accepts a JSON array of function configurations:
aliyun cdn BatchSetCdnDomainConfig \
--DomainNames cdn.yourdomain.com \
--Functions '[
{
"functionName": "filetype_based_ttl_set",
"functionArgs": [
{"argName": "ttl", "argValue": "31536000"},
{"argName": "file_type", "argValue": "js,css,png,jpg,webp,woff2,svg"}
]
},
{
"functionName": "filetype_based_ttl_set",
"functionArgs": [
{"argName": "ttl", "argValue": "60"},
{"argName": "file_type", "argValue": "html"}
]
}
]'
Setting Up DCDN for Dynamic Acceleration
This is where it gets interesting. DCDN accelerates your API calls and dynamic HTML by routing them through Alibaba’s backbone instead of the public internet.
Add Your API Domain to DCDN
aliyun dcdn AddDcdnDomain \
--DomainName api.yourdomain.com \
--Sources '[{"content":"origin.eu-central-1.aliyuncs.com","type":"ipaddr","port":443,"priority":"20","weight":"10"}]' \
--Scope overseas
Enable Dynamic Content Acceleration
Configure HTTPS and dynamic routing through BatchSetDcdnDomainConfigs. The dynamic function controls how DCDN handles non-cacheable requests:
aliyun dcdn BatchSetDcdnDomainConfigs \
--DomainNames api.yourdomain.com \
--Functions '[
{
"functionName": "dynamic",
"functionArgs": [
{"argName": "enable", "argValue": "on"},
{"argName": "dynamic_route_origin", "argValue": "https"}
]
},
{
"functionName": "websocket",
"functionArgs": [
{"argName": "switch", "argValue": "on"}
]
}
]'
The dynamic function tells DCDN to use intelligent routing for requests that can’t be served from cache. DCDN probes multiple paths between its PoPs in real-time and picks the fastest one. During periods of heavy congestion on the China-Europe path, this can mean the difference between a 200ms response and a 2-second timeout.
WebSocket Support
If your application uses WebSockets (chat, real-time updates, etc.), DCDN can accelerate those connections too. The websocket function enables persistent connection routing through the backbone. I’ve seen WebSocket connection stability go from 60% to 99%+ for users in China after enabling DCDN.
The Architecture That Works
After years of iteration, here’s the architecture I use for applications that need to be fast globally:
graph LR
EU[European Users] --> CDN[CDN Frankfurt PoP]
CDN --> Origin[Origin Frankfurt]
CN[Chinese Users] --> DCDN[DCDN Shanghai PoP]
DCDN -->|Alibaba Backbone| Origin
For even better China performance, add a CEN (Cloud Enterprise Network) connection:
graph LR
CN[Chinese Users] --> DCDN[DCDN Shanghai PoP]
DCDN --> CEN[CEN]
CEN --> Replica[Origin Replica Shanghai]
The CEN approach is what I described in my Xataka interview. It gives you a private, high-bandwidth connection between regions that’s not subject to public internet congestion. Combined with DCDN, this gives Chinese users a near-domestic experience even when the origin is in Europe.
Real Numbers
Here are actual measurements from one of my production setups, testing from Shanghai to a Frankfurt origin:
| Setup | TTFB (p50) | TTFB (p95) | Full Page Load |
|---|---|---|---|
| Direct (no CDN) | 420ms | 1,200ms | 8.2s |
| CDN only (static) | 380ms | 900ms | 3.1s |
| DCDN (dynamic) | 180ms | 350ms | 2.4s |
| DCDN + CEN + China replica | 45ms | 120ms | 0.9s |
The jump from “direct” to “DCDN” is where most of the value is. You get a 50-70% improvement in dynamic content delivery without needing infrastructure in China. Adding a China-based origin through CEN gets you the rest of the way, but it also adds significant cost and operational complexity.
Common Pitfalls
DNS resolution: Chinese ISPs sometimes return stale or wrong DNS results for international domains. Use Alibaba Cloud DNS with separate resolution lines for China Telecom, China Unicom, and China Mobile. Each ISP has different optimal paths.
Certificate compatibility: some older Chinese browsers and systems don’t trust certain CAs. I use DigiCert or GlobalSign certificates for domains that serve Chinese users, as they have the broadest trust chain compatibility in China.
ICP enforcement: if you set CDN/DCDN scope to domestic or global, you need a valid ICP filing. Without it, Alibaba Cloud will reject the domain configuration. If you’re a foreign company without a Chinese entity, you can still use overseas scope and benefit from Hong Kong/Singapore PoPs, which are much better than nothing.
Content restrictions: DCDN routes traffic through Chinese PoPs, which means your content is subject to Chinese internet regulations. Make sure your content complies with local laws. This isn’t a technical issue, but it’s caught people off guard.
Cost Considerations
CDN pricing is based on bandwidth or traffic (you choose the billing model). For most applications, traffic-based billing is cheaper:
- Overseas traffic: ~$0.08/GB
- Mainland China traffic: ~$0.04/GB (cheaper because of the massive domestic CDN infrastructure)
DCDN adds a premium for dynamic acceleration, typically 2-3x the cost of static CDN. But when you compare it against the alternative (provisioning a CEN connection, maintaining infrastructure in China, dealing with cross-border compliance) DCDN is often the most cost-effective when done as your first step.
My Recommendation
If you’re just starting to serve Chinese users:
- Start with CDN for static assets,
overseasscope. Immediate improvement, no ICP needed. - Add DCDN for your API and dynamic content. This is where the latency improvement happens.
- Only add CEN + China infrastructure if you need sub-100ms latency or have data residency requirements.
I’ve been through all three stages across different projects. The biggest bang for the buck is always step 2 (DCDN dynamic acceleration). It’s the one change that makes Chinese users stop complaining about speed and start converting.
For more on my experience with cross-border infrastructure on Alibaba Cloud, see my posts on CEN and ICP, migrating between regions, and lowering latency with EIP and BGP.