All Products
Search
Document Center

CDN:Accelerate a web portal with Alibaba Cloud CDN

Last Updated:Jun 21, 2026

Web portals typically serve static resources such as images, text, and videos. If your website consists mostly of small files and images, select Image and Small File as the business type. If your website has a large amount of video and audio content, select VOD. This tutorial uses testcdn.top as an example to show how to use Alibaba Cloud CDN to accelerate the delivery of OSS resources for the Image and Small File business type.

Performance benefits

A network probe using Alibaba Cloud Application Real-Time Monitoring Service (ARMS) compared the direct URL of an OSS resource with its CDN-accelerated domain name. The results are as follows.

Note

Results from a network probe may vary depending on network conditions.

The network probe shows that the CDN-accelerated domain had 100% availability with an average response time of 712.44 ms. In contrast, direct connections to the OSS resource failed, resulting in 0% availability, with requests failing in an average of 1.1 s.

Based on this data, using Alibaba Cloud CDN can improve response time by approximately 35%.

Prerequisites

Add a domain name

  1. Log in to the Alibaba Cloud CDN 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, set Acceleration Region to Global (Excluding Chinese mainland), enter images.testcdn.top for Domain Name to Accelerate, select Image and Small File for Business Type, and select Default Resource Group for Resource Group.

    Important
  5. Click Add Origin, and on the Add Origin page, select OSS Domain for Origin Information Type, select the Bucket Domain for Public Access, select Primary for Priority, enter 10 for Weight, and enter 80 for Port.

  6. Select the checkbox to agree to the Data Cross-border Compliance Commitment, click Next, and then click Back to Domain Names.

Configure a CNAME record

  1. On the Domain Names page, find the domain name that you added and copy its CNAME value.

  2. Log in to the Alibaba Cloud DNS console.

  3. On the Public DNS page, find the root domain testcdn.top and click Configure in the Actions column.

  4. On the DNS Settings page, click Add Record. For Record Type, select CNAME. For Hostname, enter images. For DNS Request Source, select Default. For Record Value, enter the CNAME value that you copied in Step 1.

Troubleshooting

  • Problem description

After you add the domain name and configure the CNAME record, accessing the accelerated resource returns a 403 error.

E:\>curl -v http://images.testcdn.top/pic_03.jpg
*   Trying 12xxx 9:80...
* Connected to images.testcdn.top (1xxx) port 80
> GET /pic_03.jpg HTTP/1.1
> Host: images.testcdn.top
> User-Agent: curl/8.4.0
> Accept: */*
>
< HTTP/1.1 403 Forbidden
< Server: Tengine
  • Solution

This error indicates the OSS bucket is private. To maintain security, grant Alibaba Cloud CDN access to your private bucket instead of making it public. Follow these steps:

  1. In the Alibaba Cloud CDN console, on the Domain Names page, find the accelerated domain name images.testcdn.top and click Manage.

  2. On the domain management page, click the Origin Fetch tab. In the Alibaba Cloud OSS Private Bucket Access section, turn on the Status switch and select Bucket in the Same Account for Type.

  3. Retry accessing the resource. The resource should now load correctly.

    E:\>curl -v http://images.testcdn.top/pic_03.jpg
    * Trying 12xxx9:80...
    * Connected to images.testcdn.top (1xxx9) port 80
    > GET /pic_03.jpg HTTP/1.1
    > Host: images.testcdn.top
    > User-Agent: curl/8.4.0
    > Accept: */*
    >
    < HTTP/1.1 200 OK
    < Server: Tengine
    < Content-Type: image/jpeg
    < Content-Length: 8775526