Volcano Engine Content Delivery Network (CDN) uses a large network of cache nodes to deliver site content closer to end users. This reduces the distance that data must travel and lowers latency, thereby accelerating access speeds. You can associate a custom domain with your bucket and enable CDN acceleration for that domain. Then, you can access TOS resources through the accelerated domain to improve performance. This topic provides notes and steps for creating, using, and disabling accelerated domains.
Most internet applications use a dynamic-static separation architecture. In this architecture, static resources such as videos, audio files, images, and JavaScript scripts are stored in object storage solutions, and a CDN is used to accelerate access. The benefits of this architecture include:
- Faster resource loading: Site content is distributed to nearby CDN cache nodes to ensure quick access to the necessary resources. This optimizes the user experience by avoiding public network congestion and reducing access latency.
- Reduced traffic costs: Traffic generated when Volcano Engine CDN retrieves resources from TOS is calculated as CDN back-to-origin traffic. This traffic is billed at a lower rate than Outbound traffic over the public network.
- Flexible access control: Volcano Engine CDN supports back-to-origin for private TOS buckets, which can mask the origin server's domain. Volcano Engine CDN also offers referrer-based and origin hotlink protection, IP allowlists and denylists, IP access speed limits, and URL authentication. For more information, see Access control overview.
CDN delivers data from its cache nodes when you access TOS using an accelerated domain name. CDN will charge you separately for the traffic based on the volume of data transferred. For more information, see Billing notes. Before you access TOS resources via CDN, make sure that:
- You have activated TOS, and your bucket contains resources.
- You have completed the Internet content provider (ICP) filing process for the domain name with the Ministry of Industry and Information Technology.
- Accelerated domain names are currently only available in China (Beijing), China (Guangzhou), and China (Shanghai).
- After you complete cross service authorization in the CDN console, the ServiceRoleForCDN role will appear in the IAM role list. Deleting this role will render cross-service access unavailable. Consequently, CDN will be unable to access files in a private bucket.
- If you use TOS together with CDN, CDN will cache data in its nodes based on the Cache-Control and Expires headers returned by the origin server. We recommend customizing cache rules in the CDN or setting Cache-Control and Expires headers when uploading objects to TOS. For more information, see TOS API overview.
- For existing objects in a bucket, you can add these headers by modifying the metadata. For more information, see TOS API overview.
- TOS provides both mirror-based and redirect-based back-to-origin. To use both CDN and the redirection feature of TOS, enable Redirection in the Back-to-Origin Configuration section of the CDN console. For more information, see Configuring redirection rules.
Creating an accelerated domain name
Step 1: Enable CDN acceleration for your domain
tip
The TOS console provides the basic domain configuration necessary for CDN acceleration. To use advanced CDN features, enable domain acceleration according to the CDN documentation. For instructions, see Adding a domain name for acceleration. Create an accelerated domain
Enable acceleration for an existing domain
- In the left navigation pane, click Buckets. In the Buckets list, click the bucket you want to manage.
- In the left navigation pane, select Domain name and transfer acceleration > Domain Management. On the Domain Management page, click Create an accelerated domain.
- In Step 1 of the configuration wizard, titled Add an accelerated domain, set the following parameters and click Select.
- Domain Name Information: The bucket name is displayed by default.
- Business type: Select from Web acceleration, Download acceleration, or Video on Demand (VOD) Acceleration. For more information, see Acceleration scenarios.
- Accelerated Domain Name: Enter the domain to be accelerated.
warning
During the domain configuration process, CDN will validate ownership of the domain, the ICP filing status, and other requirements. If the domain does not meet these requirements, an error will be reported. For more information, see Domain checking. - Project: Select the project to which the domain belongs.
- In Step 2 of the configuration wizard, titled Parse CNAME, click Confirm.
- In the left navigation pane, click Buckets. In the Buckets list, click the bucket you want to manage.
- In the left navigation pane, select Domain name and transfer acceleration > Domain Management.
- On the Domain Management page, click Turn on acceleration next to the domain name you want to accelerate.
- In Step 1 of the configuration wizard, titled Add an accelerated domain, set the following parameters and click Select.
- Domain Name Information: The bucket name is displayed by default.
- Business type: Select from Web acceleration, Download acceleration, or Video on Demand (VOD) Acceleration. For more information, see Acceleration scenarios.
- Accelerated Domain Name: The domain to be accelerated is displayed.
warning
During the domain configuration process, CDN will validate ownership of the domain, the ICP filing status, and other requirements. If the domain does not meet these requirements, an error will be reported. For more information, see Domain checking. - Project: Select the project to which the domain belongs.
- In Step 2 of the configuration wizard, titled Parse CNAME, click Confirm.
Step 2: Configure cache rules
- In the left navigation pane, click Buckets. In the Buckets list, click the bucket you want to manage.
- In the left navigation pane, select Domain name and transfer acceleration > Domain Management.
- On the Domain Management page, click Manage CDN acceleration next to the domain name created in Step 1.
- On details page of the domain, click the Cache Configuration tab.
- In the upper-right corner of the Cache Configuration tab, click Edit Configuration.
- In the Node Cache Rules area, click Add Rule to configure cache rules. For more information, see Node cache rules.
- Once you have finished configuring, click Submit Edits in the upper-right corner of the page.
warning
By default, if no cache rules are configured, CDN will cache data in its nodes based on the Cache-Control and Expires headers returned by the origin server. By default, TOS does not include these headers in its responses unless they were specified when the object was uploaded.
To direct traffic through CDN, you must add a CNAME record for your accelerated domain name with your DNS provider, pointing it to the assigned CNAME domain. Once resolved, requests will be routed to CDN nodes for accelerated access.
- In the left navigation pane, click Buckets. In the Buckets list, click the bucket you want to manage.
- In the left navigation pane, select Domain name and transfer acceleration > Domain Management.
- On the Domain Management page, find the CNAME value in the CNAME section of the domain name you want to configure.
- Add a CNAME record with your DNS provider to point your accelerated domain to the CNAME value obtained above. Then, wait for DNS propagation. These steps may vary by provider. For more information, see Connecting your site to a CDN.
(Optional) Step 4: Configure CDN notification
CDN accelerates access to resources by caching TOS data at edge nodes. Each cached object has a time-to-live (TTL). If an object is updated at the TOS origin while it is still within its TTL, CDN may continue to serve the old version of the object. Use the CDN notification feature to force CDN to update specific objects and ensure that users receive the latest data from TOS.
warning
- CDN notification is not supported for buckets with versioning enabled or suspended.
- Folder-level cache refreshing is not supported.
- CDN notification tasks are typically submitted within three minutes, though delays may occur during periods of high usage.
- In the left navigation pane, click Buckets. In the Buckets list, click the bucket you want to manage.
- In the left navigation pane, select Domain name and transfer acceleration > Domain Management.
- On the Domain Management page, click config CDN Notification next to the domain name you want to configure.
- In the CDN notification dialog box, configure the following parameters:
- Once you have finished configuring, click OK.
Using an accelerated domain name
To generate an accelerated URL, replace the bucket domain name in the original TOS URL with your accelerated domain name.
For example, if the accelerated domain is www.example.com:
- The original TOS URL is http://bucket-demo.tos-cn-beijing.volces.com/img/object-demo.png.
- The accelerated URL is http://www.example.com/img/object-demo.png.
Disabling an accelerated domain name
Disabling an accelerated domain turns it into a regular domain. You can still use it to access TOS resources, just without acceleration.
- In the left navigation pane, click Buckets. In the Buckets list, click the bucket you want to manage.
- In the left navigation pane, select Domain name and transfer acceleration > Domain Management.
- On the Domain Management page, click Stop accelerating next to the domain name you want to configure.
- Click ... > Disable in the Actions column of the domain name.
- In the box that appears, click Disable.