Alibaba Cloud CDN Guide: Domain Setup & Purge
What Is Alibaba Cloud CDN
Alibaba Cloud CDN is one of the most widely deployed CDN services in China, with 3,200+ nodes globally (2,300+ in Chinese mainland covering all 31 provinces, and 900+ overseas across 70+ countries and regions) and 180 Tbps total bandwidth. It caches origin resources at nearby edge nodes so users get content without hitting the origin, while sharply reducing origin load. If most of your users are in mainland China, it is often the best fit; see also China website overseas CDN acceleration.
To judge whether it suits you, ask three questions first: is most of your traffic static assets? Are your users concentrated in mainland China? Is the origin already stable? If all three answers are yes, the payoff is direct — in practice, a static image site can typically cut its nationwide first-screen time from 1.5+ seconds to under 300 ms after enabling CDN.
Step 1: Enable the Service and Add a Domain
- Enable CDN in the Alibaba Cloud console.
- Go to Domain Management → Add Domain:
- Acceleration domain: for example
cdn.example.com, ICP-registered (mainland) and verified for ownership. - Origin: choose OSS, ECS, SLB, or a custom origin IP/domain, and set the origin protocol (HTTP/HTTPS/follow) and port.
- Business type: image/small files, large file download, video on demand, and so on; this affects default cache policy.
- Acceleration domain: for example
- The system returns a CNAME (such as
cdn.example.com.w.cdngslb.com).
A common mistake is treating the "acceleration domain" and the "origin domain" as the same name. If your main site is example.com, it is usually better to use a subdomain like cdn.example.com as the acceleration entry and point the origin at www.example.com or an OSS bucket. That way, when you later switch CDN vendors or move origins, you only change one DNS record instead of touching the main site's resolution.
Step 2: Configure the CNAME
At your DNS provider, add a CNAME record pointing the acceleration domain to the returned CNAME. With a typical DNS panel this is one record:
| Record Type | Host | Value |
|---|---|---|
| CNAME | cdn | cdn.example.com.w.cdngslb.com |
The scheduling system then assigns the best node based on user location, carrier, and node health, supporting DNS, DoH, and 302 scheduling. CNAME propagation takes minutes; verify the status changes to "running normally."
If the status stays "not in effect" after configuration, the usual causes are: a missing trailing dot or an accidentally full domain in the CNAME value; another CDN vendor's CNAME overwriting yours; or DNSSEC on the domain breaking the scheduling resolution. Run dig cdn.example.com CNAME to check whether the answer points at Alibaba's scheduling domain, then work backward.
Step 3: Configure HTTPS and Certificates
- Enable HTTPS under Domain Management → HTTPS Config.
- Use the free certificate (auto-issued) or upload a custom certificate (with private key).
- Turn on HTTP/2 and force HTTPS redirect for security and performance. For certificate selection see SSL certificate guide 2026.
The free certificate is issued automatically and suits most personal and small-to-medium sites. If you need strict compliance or brand requirements (such as OV/EV certificates or wildcard multi-domain coverage), upload your own. Start renewing about 30 days before expiry so an expired certificate never triggers a wide access failure.
Step 4: Configure Caching and Origin
- Cache expiration: set TTL by file type, directory, or full path; cache static assets (images, CSS, JS) for 30+ days and set dynamic content to no-cache or very short TTL — see CDN cache strategy.
- Parameter filtering: ignoring query parameters raises hit ratio; keep them only when needed for dynamic parameters.
- Origin rules: set origin HOST, protocol, and timeout; the L1/L2 hierarchical cache architecture significantly reduces origin bandwidth.
A practical pattern is differentiated TTL by path: cache /static/* for 30 days, /uploads/* for 7 days, HTML pages for 10 minutes, and never cache login-related APIs. This keeps high hit ratios on static assets without letting content updates get "stuck" on edge nodes.
Step 5: Purge and Preheat
After origin updates, use the purge & preheat page:
- Purge: delete node cache (by URL or directory), for content changes.
- Preheat: push resources to nodes nationwide in advance, ideal before promotions or video releases; it sharply improves first-visit experience.
- Purges have daily quotas; use versioned URLs to reduce frequency.
For example, when a new image version goes live, instead of manually purging hundreds of URLs, add a version to the reference like logo-v2.png. The CDN caches the new URL as a fresh object, the old one expires naturally, and you save your daily purge quota.
A typical onboarding case
Take an e-commerce image site (200,000 daily pageviews, about 30 GB of images): before onboarding, origin peak bandwidth was consistently around 800 Mbps, with high origin costs and occasional saturation during promotions. The flow: enable CDN → add img.example.com as the acceleration domain pointing at an OSS origin → add a CNAME at DNS → enable free HTTPS and HTTP/2 → set 30-day and 7-day TTLs for /static/* and /uploads/*. Two weeks after launch, the node hit ratio held above 95%, origin peak bandwidth dropped below 40 Mbps, and one preheat before the promotion was enough.
Security and Pricing
- Security: referer anti-leech, URL authentication, and IP allow/deny lists; for advanced needs use WAF or DCDN full-site acceleration — see CDN security protection features.
- Billing: basic service supports pay-by-traffic and pay-by-bandwidth, plus value-added meters such as HTTPS/QUIC requests; details in CDN cost optimization guide.
- Dynamic content: if dynamic traffic is high, consider DCDN full-site acceleration — see dynamic content acceleration DCDN.
16IDC Take
Alibaba Cloud CDN's strengths are mainland node density and the integrated post-ICP experience: domain, OSS, ECS, and CDN work in one account, and intra-cloud origin traffic bills lower. For Chinese-market, static-heavy sites it is one of the most hassle-free options. If you also serve overseas users, add overseas nodes or a multi-CDN mix. For overall selection see CDN provider selection guide. More content in the CDN acceleration category.
Source: https://help.aliyun.com/zh/cdn/product-overview/what-is-alibaba-cloud-cdn
Reference: https://help.aliyun.com/zh/cdn/user-guide/add-a-domain-name (Add an acceleration domain)
Reference: https://help.aliyun.com/zh/cdn/user-guide/purge-and-preheat (Purge and preheat)
Integration & Code Examples
Example 1: Add an accelerated domain via CLI and verify the CNAME
# CLI equivalents of the console steps; parameter shapes follow the Alibaba Cloud CLI docs
aliyun cdn AddCdnDomain \
--DomainName cdn.example.com \
--CdnType web \
--Sources '[{"content":"origin.example.com","type":"domain","port":80,"priority":"20"}]'
# Fetch the assigned CNAME, then add the record at your DNS provider
aliyun cdn DescribeCdnDomainDetail --DomainName cdn.example.com \
| python3 -c 'import sys,json;print(json.load(sys.stdin)["GetDomainDetailModel"]["Cname"])'
# Verify scheduling took effect: empty output is normal for the first few minutes
dig +short cdn.example.com CNAME
When it never resolves, first check for a missing trailing dot or a CNAME overridden by another CDN, and only then suspect DNSSEC.
Example 2: Purge and preheat after a release
# Directory purge for site-wide updates, URL purge for single pages, preheat for hot pages
aliyun cdn RefreshObjectCaches \
--ObjectPath "https://cdn.example.com/static/" --ObjectType Directory
aliyun cdn RefreshObjectCaches \
--ObjectPath "https://cdn.example.com/index.html" --ObjectType File
aliyun cdn PushObjectCache \
--ObjectPath "https://cdn.example.com/products/hot-sale.html" --Area domestic
# Check task status; failures usually mean the URL is outside this domain's scope
aliyun cdn DescribeRefreshTasks --PageSize 10
Purges are quota- and rate-limited; prefer directory purges for bulk releases instead of submitting URL by URL.
Four Acceleration Metrics and Their Basis
Separate platform capability from site-level measurement first. The 3200+ nodes and 180 Tbps are platform figures describing coverage and aggregate bandwidth; the bandwidth one site can draw still depends on the plan purchased.
The table pairs four metrics with their basis. The last row belongs to one image-heavy site and does not transfer to other workloads.
| Metric | Figure quoted here | Basis |
|---|---|---|
| Node count | 3200+ (2300+ in mainland China across 31 provincial regions; 900+ overseas across 70+ countries and regions) | Publicly published node distribution |
| Network bandwidth capability | 180 Tbps | Platform capability, not per-domain capacity |
| First-screen latency | from above 1.5 seconds to under 300 milliseconds | National average for a static image site after enabling CDN |
| Edge hit rate | above 95% | Steady value for the case site two weeks after launch |
The three pre-checks still apply: is traffic mostly static, are users concentrated in mainland China, is the origin already stable. Only when all three hold do those figures mean anything for your site.
Per-Path TTL Tiers and Purge Quota
Tiered TTLs by path beat one global value: 30 days for /static/*, 7 days for /uploads/*, 10 minutes for HTML pages, and no caching at all for endpoints tied to a logged-in session. Hit rate and content freshness stop competing.
Purges carry a daily quota, so savings have to be designed into how assets are referenced: publish a new version as logo-v2.png and the new object enters cache on its own while the old one expires, without purging hundreds of URLs by hand.
Purge and preheat are different actions: purge removes edge cache after a content change, preheat pushes assets to nodes ahead of a sale or video launch. The case site did a single preheat before its promotion, which works only because the cache rules were already tiered by path.
Limitations
- This article reflects public information as of 2026-08-06; terms, prices and quotas follow the provider's current published terms.
- Third-party capability and limit statements follow their official documentation; no further commitment is implied here.
- Licensing, filing and data-residency decisions must be verified against the regulations of your operating region.
FAQ
Does a domain require ICP filing for mainland nodes?
Yes, the accelerated domain needs a completed ICP filing plus domain-ownership verification. The 2300+ mainland nodes stay unavailable until the filing clears; only the 900+ overseas nodes work before that. The filing entity must match the accelerated domain, so put it first in the rollout plan, before adding the domain in the console.
Traffic or peak bandwidth — which billing model?
Use traffic billing for peaky sites and peak-bandwidth billing for sustained load. Traffic bills per GB and peak bandwidth per Mbps, so pull 1 month of access logs, compute the 95th percentile, and compare both quotes. HTTPS and QUIC requests are separate add-ons, so keep a line in the budget for them.
Which TTL fits static images versus video?
Set TTL by change frequency, not by file type. Give versioned images, CSS, and JS 30 days or more, manual uploads under /uploads/ 7 days, HTML 10 minutes, and logged-in endpoints no cache at all. If content changes often and waiting for a purge is not an option, put the version in the filename so the new URL takes a new cache entry.
When should you avoid Alibaba Cloud CDN?
Avoid it when all users are overseas and the origin is unstable. Mainland accounts for 2300+ of the 3200+ nodes and overseas only 900+, so overseas reach needs extra regions or a multi-CDN setup, while an origin that cannot absorb misses only gets amplified. Heavy dynamic traffic belongs on DCDN instead.
Related Providers
- Aliyun CDN: Use it when most visitors are in mainland China and ICP filing is already in place.
- Cloudflare: Use it when overseas traffic shares one origin and the free tier should validate caching first.
- Tencent Cloud EdgeOne: Use it when the origin runs on Tencent Cloud and needs both L4 and L7 acceleration.
Community & Resources
Communities and official channels
- Alibaba Cloud CDN Docs — overview, domain management and purge/preheat
- Add a Domain Name — setup steps and common failure causes
- Purge and Preheat — quotas, timing and caveats
- Stack Overflow: cdn — caching and origin-pull questions
Learning resources and tools
- RFC 9111: HTTP Caching — caching semantics and Cache-Control
- web.dev — measuring first-screen performance and cache strategy
- Let's Encrypt Docs — certificate issuance and auto-renewal
- nginx Docs — origin server and cache header configuration
Original source: Alibaba Cloud Documentation ↗