All Products
Search
Document Center

:Best practices for requests to accelerated content

Last Updated:Sep 24, 2026

Elastic Compute Service (ECS) functions as important infrastructure for services. However, the deployment of ECS instances is limited to specific regions or countries. To address this limitation, you can use ECS together with Dynamic Route for CDN (DCDN). DCDN and ECS help you deploy cost-effective, high-performance, and highly reliable networks and services. DCDN can accelerate the delivery of static and dynamic content on ECS instances and provide computing and security services on points of presence (POPs). You can deploy services worldwide with a minimum number of ECS instances.

Terms

This section briefly introduces ECS and DCDN:

  • DCDN

    DCDN is a virtual network that consists of POPs. It accelerates content delivery and provides computing capabilities. You can use DCDN to accelerate the delivery of dynamic content or both static and dynamic content. DCDN supports a wide array of protocols, including HTTP, HTTPS, Transmission Control Protocol (TCP), User Datagram Protocol (UDP), and WebSocket. DCDN has more than 3,200 POPs deployed worldwide to provide protection and computing capabilities. For more information, see Dynamic Route for Content Delivery Network.

  • ECS

    ECS is a scalable cloud service. It helps you minimize IT expenses and improve operation and maintenance (O&M) efficiency. This lets you focus on the innovation of core services. For more information, see Elastic Compute Service.

Scenarios

DCDN is suitable for various industries, including online education, gaming, retail, finance, media, and social media.

Online education

Gaming

Retail

Finance

Media

Social network

  • APIs

  • Online examination

  • Online programming

  • Interactive whiteboards

  • Learning and examination reports

  • Uploads of images and audio content

  • Curriculum

  • Knowledge communities

  • Online chat

  • Online shops

  • APIs

  • Browser games

  • Turn-based games

  • Real-time interaction

  • Online multiplayer games

  • Deployment of game servers

  • In-game purchases

  • Online chat

  • Player rankings

  • Installation packages and resource plans

  • Online shops

  • APIs

  • Commodity search

  • Orders and transactions

  • Shipping updates

  • Online customer service

  • Promotional HTML5 pages

  • Sales promotions

  • Flash sales

  • Cross-border e-commerce

  • Apps and websites

  • Financial transactions

  • Financial investments

  • Cross-border financial services

  • Financial markets

  • Financial news and information

  • Real-time quotation

  • SSL and VPN services for enterprises

  • Cloud desktop

  • IPv6 services

  • Websites and apps

  • News and information

  • Breaking news

  • Logon, registration, and query services

  • Personalized recommendations

  • Comments, replies, and likes

  • APIs

  • Online chat

  • File synchronization

  • Breaking news

  • Information graphics

  • Uploads of images and text

  • Comments and replies

  • Online shops

  • Likes and gifts

  • Personal information display

Business values

DCDN provides the following benefits:

  • Acceleration Of Static And Dynamic Content

    Traditional CDN services can accelerate only static content delivery. DCDN can accelerate both static and dynamic content.

  • Compatibility With Multiple Protocols

    DCDN supports a wide array of protocols, including HTTP, HTTPS, WebSocket, TCP, and UDP. This lets you accelerate content delivery at different layers.

  • Cost-effectiveness

    DCDN minimizes expenses on ECS bandwidth, computing resources, and connections because content can be cached on distributed DCDN POPs.

  • High Availability

    DCDN has more than 3,200 POPs deployed worldwide. These POPs support a wide array of features including protection and IPv6, which allow you to keep your services available and meet different business requirements.

  • Edge Computing

    DCDN lets you customize features such as A/B testing, URI rewrite, and rate limiting on POPs.

Architecture

The following figure shows how DCDN and ECS work together:Architecture

Assume that you purchase ECS instances in Region A and Region B. Applications are deployed on the ECS instances and Server Load Balancer (SLB) is used to balance loads. DCDN is used to accelerate the delivery of content on the ECS instances. After a domain name is added to DCDN, static content and dynamic content requested by users are intelligently identified by DCDN. Then, DCDN accelerates the delivery of static content or both static and dynamic content:

  • Accelerate the delivery of static content

    Static content is cached on DCDN nodes. Users can retrieve static content from the nearest nodes.

  • Accelerate the delivery of dynamic content

    If content requested by some requests, such as POST requests, is not cached on DCDN nodes, DCDN nodes redirect the requests to the origin server to retrieve content based on an intelligent scheduling system. The system selects an optimal route for redirection.

  • Accelerate the delivery of both dynamic and static content

    DCDN intelligently identifies static and dynamic content. Static content is cached on DCDN nodes. Users can directly retrieve the cached static content from the nearest DCDN nodes. Requests for dynamic content are redirected to the origin server through an optimal route selected by the intelligent scheduling system.

Configuration process

Prerequisites

Before you start, make sure that the following requirements are met:

  • An ECS instance is created and applications are deployed on it. The ECS instance is assigned a public IP address. If you have configured an SLB instance for the ECS instance, make sure that the SLB instance is assigned a public IP address and can provide services to external systems.

  • A domain name with a valid Internet Content Provider (ICP) number is prepared. If the domain name does not have an ICP number, you can apply for one through Alibaba Cloud ICP Filing System.

  • DCDN is activated. For more information, see Activate DCDN.

Procedure

Procedure

Basic settings (required)

Step 1: Add A Domain Name To DCDN

  1. Log on to the DCDN console.

  2. In the left-side navigation pane, click Domain Names.

  3. On the Domain Names page, click Add Domain Name.

  4. On the Add Domain Name page, configure the parameters that are described in the following table.

    Parameter

    Description

    Domain Name to Accelerate

    • Domain name type: The domain name to be accelerated can be a specific domain name such as example.aliyundoc.com or a wildcard domain name such as *.aliyundoc.com.

    • Domain name format: The domain name must be in lowercase letters.

      Important

      If the domain name contains Chinese characters, such as 阿里云.网址, you must apply for an ICP number for the domain name in Chinese characters and use the Punycode tool to convert the Chinese characters into English letters, such as xn--fiq****.xn--eq****. Then, you can specify the converted domain name as the domain name that you want to accelerate.

    • Requirements for wildcard domain names: For more information, see Does DCDN support wildcard domain names?.

      Important
      • The wildcard domain name that you specify and the domain names that match the wildcard domain name must belong to the same Alibaba Cloud account. Otherwise, an error message appears when you add domain names. To request technical support from Alibaba Cloud, submit a ticket.

      • If a wildcard domain name is not added to DCDN, you can add the domain names that match the wildcard domain name to DCDN using different Alibaba Cloud accounts.

    • You cannot add domain names that have been added to other Alibaba Cloud services.

      If the system prompts that the domain name is added to other Alibaba Cloud services such as ApsaraVideo VOD and CDN, submit a ticket.

    • Each Alibaba Cloud account can add at most 50 domain names to Alibaba Cloud CDN.

      If the average daily peak bandwidth values of your domain names exceed 50 Mbit/s, you can submit a ticket to add more domain names to DCDN. Make sure that the increase of domain names does not incur business risks.

    • The content that is delivered from the domain name must be legal and comply with the Terms of Service for DCDN. For more information, see Limits.

    Resource Group

    Select the Default Resource Group or a custom resource group. For information about how to create a resource group, see Create a resource group.

    Business Type

    Select DCDN.

    Location

    Chinese Mainland Only is selected in this example. If you select Chinese Mainland Only or Global, you need to apply for an ICP number for the domain name. We recommend that you perform ICP filing using Alibaba Cloud ICP Filing System. The Ministry of Industry and Information Technology (MIIT) may not immediately update the filing results to their database after you submit domain name information. We recommend that you configure the domain name eight hours after you submit the domain name information.

    Note

    The pricing varies based on the acceleration region. Select an acceleration region as needed. For more information about billing, visit the DCDN pricing page.

  5. On the Add Domain Name page, click Add Origin Server and configure the parameters that are described in the following table.

    Parameter

    Description

    Type

    Select the type of the origin server and enter the address of the origin server.

    • OSS Domain

      • If you use an Object Storage Service (OSS) bucket as the origin server, you can enter the public domain name of the OSS bucket, such as, ***.oss-cn-hangzhou.aliyundoc.com.

      • You can obtain the public domain name of an OSS bucket in the OSS console. You can also select the domain name of an OSS bucket that belongs to the current Alibaba Cloud account from the Domain Name drop-down list.

    • IP

      You can enter public IP addresses of one or more servers. Public IP addresses of Alibaba Cloud ECS instances do not need to be reviewed. Private IP addresses are not supported.

    • Site Domain

      You can enter the domain name of an origin server. To configure multiple domain names, repeat the preceding steps.

      Note
      • The origin domain name must be different from the accelerated domain name. Otherwise, a DNS resolution loop occurs, and requests cannot be redirected to the origin server.

      • The domain name must be in lowercase letters.

      • If the domain name contains Chinese characters, such as 阿里云.网址, you must apply for an ICP number for the domain name in Chinese characters and use the Punycode tool to convert the Chinese characters into English letters, such as xn--fiq****.xn--eq****. Then, you can specify the converted domain name as the domain name that you want to accelerate.

    Priority

    You can configure priorities to specify primary and secondary origin servers. The primary origin server has a higher priority than the secondary origin server. DCDN preferentially redirects requests to the primary origin server.

    For example, if you specify Origin Server A as the primary origin server and specify Origin Server B as the secondary origin server, user requests are preferentially redirected to Origin Server A. If Origin Server A is down, user requests are redirected to Origin Server B until Origin Server A works as expected again.

    Weight

    If origin servers have the same priority, DCDN redirects requests to the origin servers based on the weights of the origin servers. This implements load balancing between the origin servers. You can specify a weight as needed.

    • The valid values of origin server weights are 1 to 100. A greater value indicates a higher weight. An origin server with a higher weight receives more user requests.

    • The default value is 10.

    For example, you specify Origin Server A and Origin Server B as primary origin servers. If the weight of Origin Server A is 80 and the weight of Origin Server B is 20, DCDN redirects 80% of requests to Origin Server A and 20% of requests to Origin Server B.

    Port

    Select a port based on the protocol that is supported by the origin server.

    • Port 80: Requests are redirected to the origin server over port 80.

    • Port 443: Requests are redirected to the origin server over port 443. Make sure that the origin server supports HTTPS.

    Note

    Before you can specify a custom port, you must set Static Origin Protocol Policy and Dynamic Origin Protocol Policy to HTTP after you add a domain name. For more information, see Configure the static origin protocol policy and Configure dynamic content retrieval settings.

  6. After you add an origin server, click Next.

  7. Wait for manual verification.

    After the domain name passes the verification, the status of the domain name changes to Enabled. In this case, the domain name is added to DCDN.

Step 2: Run Tests (optional)

After you add a domain name to DCDN, we recommend that you test whether the domain name is accessible before you update the CNAME record of the domain name. This ensures that DNS updates do not affect your business.

Note

This testing procedure simulates normal DCDN access and incurs charges. You are charged for the DCDN basic service and any value-added services used during the test. The billing method is the same as for regular DCDN usage. For more information, see Billing overview.

  1. Get the domain CNAME

    1. Log on to the DCDN console.

    2. In the left-side navigation pane, click Domain Names.

    3. On the Domain Names page, copy the CNAME that corresponds to your domain name.

      Note

      Copy the CNAME of a domain name that is in the Normal state.

  2. Get the IP address for the CNAME

    Note

    The IP address returned by the ping command is for reference only. The actual IP address is the one that is returned when you ping your actual CNAME.

    • On Windows: Open a Command Prompt window. In the command line, ping the CNAME to obtain the IP address from the ping.

    • On macOS: Open a Terminal window and run the dig command on the CNAME to obtain the IP address from the dig output.

  3. Modify the local hosts file

    Add an entry to your local hosts file that maps the IP address from Step 2 to your domain name. The entry must use the format IP address domain name, and the order is important.

    For example, if your domain name is example.com, its CNAME is example.com.w.kunlunsl.com, and pinging the CNAME returns the IP address 192.168.0.1, add a mapping as shown in the following steps.

    • For Windows systems, the file path is C:\Windows\System32\drivers\etc\hosts. The following figure shows an example of a successful binding.

    • On macOS, the file path is Finder > Go > Go to Folder > /etc/hosts. The figure below shows an example of a successful binding.

  4. Test domain accessibility

    After modifying the hosts file, open the domain name in a browser on your computer. Use your browser's developer tools to check the result.

    • If the IP address shown after Remote Address matches the IP address that you added to the hosts file, your configuration is correct. You can now configure the CNAME with your DNS service provider.

    • If the IP address shown after Remote Address does not match the IP address in your hosts file, the configuration is incorrect. Verify that the IP address in the hosts file is correct and matches the IP address for the CNAME.

    Once you can access the domain name, you can perform other validation tests as needed.

Step 3: Add A CNAME Record

You need to add a CNAME record for the domain name at your DNS service provider. Alibaba Cloud DNS is used in this example to demonstrate how to add a CNAME record. The procedure for adding a CNAME record at a third-party DNS service provider is similar.

  1. Log on to the DCDN console, navigate to the Domain Names page, and then copy the CNAME of the domain name.

  2. Add a CNAME record.

    1. Log on to the Alibaba Cloud DNS console with the Alibaba Cloud Account To Which The Domain Name Belongs.

    2. Optional: In the Alibaba Cloud DNS console, add a domain name that is not registered with Alibaba Cloud.

      Note

      If the domain name is not registered with Alibaba Cloud, you must add the domain name to Alibaba Cloud DNS before you can add a DNS record for it. For more information, see Domain management. If the domain name is registered with Alibaba Cloud, skip this step.

    3. On the DNS page, find the root domain of your domain name and click DNS Settings in the Actions column.

    4. Click Add DNS Record and add a CNAME record.

      Note

      The CNAME record of a specific domain takes precedence over that of a wildcard domain. If the domain name to be accelerated is a wildcard domain name and the host record includes an asterisk (*), you must delete all effective DNS records of the second-level domains that match the wildcard domain name.

      Parameter

      Description

      Example

      Record Type

      Select CNAME.

      CNAME

      Hostname

      • If the domain name is a root domain, set the host record to @.

      • If the domain name is a wildcard domain, set the host record to *.

      • If the domain name is a subdomain, set the host record to the subdomain prefix.

      • Root domain example

        • domain name: aliyundoc.com. Host record: @.

        • domain name: aliyundoc.com.cn. Host record: @.

      • Wildcard domain example

        • domain name: .aliyundoc.com. Host record: *.

        • domain name: .aliyundoc.com.cn. Host record: *.

        • domain name: *.example.aliyundoc.com. Host record: *.example.

        • domain name: *.example.aliyundoc.com.cn. Host record: *.example.

      • Subdomain example

        • domain name: example.aliyundoc.com. Host record: example.

        • domain name: example.aliyundoc.com.cn. Host record: example.

        • domain name: www.example.aliyundoc.com. Host record: www.example.

        • domain name: www.example.aliyundoc.com.cn. Host record: www.example.

      Note

      The ".com.cn" suffix is an example of a top-level domain that has two parts.

      Query Source

      Default.

      We recommend that you use the default value.

      Record Value

      Enter the CNAME record value of the domain name.

      Note

      Each domain name has a unique CNAME value. A second-level domain cannot use the CNAME of its primary domain name. To accelerate a second-level domain, add it to DCDN and map it to its own CNAME. Alternatively, add a wildcard domain to DCDN. The CNAME of the wildcard domain can be used by its second-level domains. For more information about how to add a wildcard or second-level domain name, see Add a domain name.

      www.example.com.w.kunlunsl.com

      TTL

      TTL is the cache time. The smaller the value, the faster the modified record takes effect worldwide. The default value is 10 minutes.

      We recommend that you use the default value.

    5. Click OK.

      After you add a CNAME record, it takes effect immediately. If you modify the CNAME record, it takes 10 minutes for the updates to take effect because the default TTL value of a CNAME record is 10 minutes. The time period varies based on the TTL value that you specify for the CNAME record. The system may prompt that you must add a CNAME record. Ignore the message.

Step 4: Verify That The CNAME Record Works As Expected

  • Method 1: Quick verification in the DCDN console

    1. Log on to the DCDN console and navigate to the Domain Names page.

    2. Select the domain name and move the pointer over the CNAME Status column. The CNAME Configuration Guide tooltip appears.

    3. Click Open Configuration Guide and then click Search.

  • Method 2: Run the ping command to ping the domain name.

    1. Open Command Prompt in Windows.

    2. Run the ping command to ping the domain name. If the CNAME in the output matches the CNAME that is assigned to the domain name in the DCDN console, the DCDN service is enabled for the domain name.

Advanced settings (optional)

After you enable DCDN to accelerate the delivery of content on the ECS instance, you can configure advanced settings as needed.

Scenario

Description

Implementation

References

Accelerate the delivery of both static and dynamic content

After you enable acceleration for dynamic content delivery, DCDN automatically identifies dynamic content and static content. Static content such as images, JavaScript, and CSS code is cached on DCDN POPs so that users can retrieve content from the nearest DCDN POPs. For requests that request dynamic content, such as POST requests, DCDN selects an optimal route to redirect the requests to the origin server to retrieve the requested content.

Enable acceleration for dynamic content delivery

How to enable:

Navigate to the Domain Name Configuration > Acceleration Rules > Dynamic Acceleration page.

One-click expansion of the service area

If most your users and the ECS instances are located in the Chinese mainland, you can set the accelerated region to Chinese Mainland Only. As your business develops, your users may be located around the world. If requests from your users are all sent to DCDN POPs that are deployed in the Chinese mainland, content delivery can be slow. In this case, you can change the accelerated region to Global. Requests can be scheduled to POPs that are nearest to the users.

Change the acceleration region

Change the service location

Balance loads on origin servers

DCDN can redirect requests to primary and secondary origin servers based on the round-robin algorithm to balance loads on the origin servers. In addition, DCDN can automatically switch to another origin server when an error occurs on one origin server.

This feature is applicable to the following scenarios:

  • Switch from one ECS instance to another ECS instance that is deployed in a different zone but in the same region. For example, you can switch from an ECS instance in Beijing Zone A to an ECS instance in Beijing Zone B.

  • Switch from one ECS instance to another ECS instance that is deployed in a different region. For example, you can switch from an ECS instance in the China (Beijing) region to an ECS instance in the China (Qingdao) region.

  • Switch from one cloud service provider to another cloud service provider. For example, you can switch from Alibaba Cloud to Tencent Cloud.

  • between public clouds and traditional Internet Data Centers (IDCs).

Specify primary and secondary origin servers

Configure an origin server

Meet requirements such as DNS settings, latency, and availability

You can enable the IPv6 feature to meet business requirements, including DNS settings, latency, and availability.

Enable IPv6

Enable IPv6

For more information about DCDN, see What is DCDN?.