All Products
Search
Document Center

CDN:CDN beginer's guide

Last Updated:Nov 18, 2025

This guide explains the Alibaba Cloud Content Delivery Network (CDN) workflow, from service activation to content acceleration, to help you quickly get started with CDN.

Core concepts

The following table explains basic concepts to help you understand and use CDN. For a more basic concepts, see Basic concepts of CDN.

Concept

Description

Origin server

The server that hosts your original website files, such as images, CSS, and JS files. CDN retrieves content from the origin server and delivers it to users.

Accelerated domain name

The domain name you want to accelerate with CDN. This is the domain name that visitors for your website enter in their browsers, such as www.example.com.

CNAME record

A type of DNS record. You must change the DNS record for your accelerated domain name from an A or AAAA record to a CNAME record and point it to a dedicated domain name from the CDN service. This directs user requests to the CDN network.

Point of presence (POP)

A server deployed by CDN in a global network of locations close to your users. User requests are intelligently routed to the nearest POP, which responds cached content to users to accelerate content delivery.

Origin fetch

The process in which an POP requests the latest file from the origin server. This happens when the requested file is not cached on the POP or the cache has expired.

Cache hit ratio

The percentage of total requests that are served directly from a CDN POP's cache. A higher cache hit ratio indicates better acceleration performance, fewer origin fetches, and reduced load on your origin server.

Billing

  • Alibaba Cloud CDN billing includes Basic Services (fees for CDN acceleration) and Value-added Services (fees for the number of HTTPS requests, real-time log entries, and other items). For more information, see Alibaba Cloud CDN pricing.

  • Basic Services are billed automatically when you use Alibaba Cloud CDN. Value-added Services are disabled by default and are billed only after you manually enable them.

  • Both Basic Services and Value-added Services use a pay-as-you-go billing method by default.

  • For both Basic Services and Value-added Services, Alibaba Cloud CDN also offers resource plans with discounts to standard pricing. For more information, see Purchase a resource plan.

Workflow

Phase 1: Preparation

Before you start, ensure you have the following resources:

  • A domain name: You must have access to the domain name and the permission to modify its DNS records.

  • A publicly accessible origin server: This can be an IP address, another domain name, or the endpoint of an Alibaba Cloud Object Storage Service (OSS) bucket.

Note

In accordance with Chinese laws and the requirements of the Ministry of Industry and Information Technology (MIIT), websites, apps, and other services that resolve to servers in the Chinese mainland must obtain an ICP filing to confirm their legitimacy before providing publicly accessible services.

Phase 2: Activate and configure CDN

  1. Activate CDN.

  2. Add a domain name:

    1. Select an acceleration region based on the location of your website's users.

      User location

      Acceleration effect

      Acceleration region

      Chinese mainland

      All user requests are routed to POPs in the Chinese mainland. Traffic from outside the Chinese mainland, including Hong Kong (China), Macao (China), and Taiwan (China), is routed to CDN POPs of China Telecom in East China.

      Chinese Mainland Only

      Regions outside the Chinese mainland, including Hong Kong (China), Macao (China), and Taiwan (China)

      All user requests are routed to CDN POPs outside the Chinese mainland. Users from the Chinese mainland are routed to CDN POPs in Japan, Singapore, and Hong Kong (China).

      Global (Excluding the Chinese Mainland)

      Global

      All user requests are routed to the nearest optimal POP.

      Global

    2. If you are adding your domain name to the CDN console for the first time, you must verify the ownership of the domain name through its DNS records. After a domain is verified, you do not need to verify it or its subdomains again.

    3. Configure your origin server. This tells Alibaba Cloud CDN where to fetch resources that are not in the cache.

  3. Configure HTTPS: If your application supports HTTPS or you want your domain name to support HTTPS, configure an HTTPS certificate. Otherwise, your domain will not be accessible via HTTPS.

    Skip this step if your domain name does not support HTTPS and you do not plan to enable it.

  4. Configure CDN security and performance optimization:

    • Malicious attacks or traffic can cause sudden spikes in bandwidth usage or data transfers, leading to high costs. To prevent these risks, configure appropriate security measures.

    • Configure features such as cache expiration rules and page optimization to improve the CDN cache hit ratio and access performance, and to reduce origin-fetch traffic.

Phase 3: Configure a CNAME record

  1. Test domain name accessibility: After adding your domain, test it locally to ensure it is accessible. Once you verify that the domain works as expected, you can point its DNS record to the CNAME. This process ensures a smooth transition without affecting your existing services.

  2. Configure a CNAME record: After you add a domain name, Alibaba Cloud CDN assigns a corresponding CNAME to it. Point the DNS record of your accelerated domain name to the assigned CNAME at your DNS provider to activate the CDN service.

Most popular features

  • Origin settings: CDN offers customizable origin configurations such as specifying the origin-fetch protocol, origin addresses, and modifying origin-fetch requests.

  • Resource monitoring: You can view core metrics for your accelerated domain names, such as traffic, bandwidth, number of requests, origin-fetch traffic/bandwidth, and cache hit ratio, to understand the acceleration performance.

  • Logs and reports: CDN provides offline logs, real-time logs, and operational reports to help you identify issues and improve your CDN service quality.

  • Purge and prefetch resources: Use these features to update or publish origin resources, clear non-compliant resources, or apply domain name configuration changes. These features also help reduce the load on your origin server.

FAQ

Why is it not recommended to use a root domain (apex domain) for CDN acceleration?

You should not use a root domain (e.g., example.com) for CDN acceleration due to a fundamental DNS limitation.

  • Problem: To enable CDN, you must point your domain to a CDN-provided CNAME record. However, the DNS specification states that a CNAME record cannot coexist with other record types at the root level (the @ record). This includes essential records like MX (for email) and TXT.

  • Consequence: If you create a CNAME record for your root domain, you will interrupt other services associated with it, such as your email.

  • Solution: The standard practice is to use a subdomain, such as www.example.com or static.example.com, for CDN. This isolates the CNAME requirement to the subdomain, allowing your root domain to maintain its necessary MX and other records without conflict.

What are the most effective ways to reduce my CDN costs?

There are three main strategies to manage and reduce your CDN costs:

  1. Optimize Your Cache Hit Ratio: This is the most impactful way to lower costs. A higher cache hit ratio reduces the number of requests that need to be fetched from your origin server, thus lowering your origin-fetch data transfer fees.

    • Action: Review your cache expiration rules. For static assets that rarely change (e.g., images, CSS, JavaScript files), set a long cache duration (Time-to-Live or TTL).

  2. Purchase a Resource Plan: If your usage is consistent and predictable, a resource plan is typically more cost-effective than the default pay-as-you-go mode.

    • Action: Analyze your typical monthly data transfer and HTTPS request volume. Purchase a resource plan that matches your usage to get a lower unit price.

  3. Enable a Bandwidth Cap: This is crucial for preventing unexpectedly high bills caused by traffic spikes or malicious activity.

    • Action: Set a bandwidth cap in the CDN console. If your bandwidth usage exceeds this threshold, the CDN service will be automatically suspended, protecting you from further costs.

What's the difference between "Purge" and "Prefetch" in Alibaba Cloud CDN?

The key difference is that Purge invalidates content already on the CDN, while Prefetch proactively loads new content onto the CDN.

  • Purge (Cache Invalidation)

    • What it does: Marks specific cached content on POPs as "stale" or "invalid." It does not immediately delete the file.

    • How it works: When a user next requests the purged URL, the POP sees that its cached version is invalid. It then fetches the latest version from your origin server, delivers it to the user, and caches the new copy.

    • When to use it: After you've updated an existing file on your origin server (e.g., replaced logo.png or main.js) and you need to force all users to get the fresh version.

  • Prefetch (Cache Warming)

    • What it does: Proactively loads content from your origin server onto the CDN POPs before any user has requested it.

    • How it works: You provide a list of resource URLs. CDN POPs then fetch these files and store them in their cache. The very first user request for that content will then be a fast cache hit.

    • When to use it: Before a marketing campaign or product launch. Pre-warming your new landing page and its assets ensures a fast experience for the first wave of visitors and reduces the initial load on your origin server.

Next steps and best practices

For more features and practical guidance, see the Console Operation Guide and Best Practices.