The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.
1. Activate a Tencent Cloud account and complete identity verification. For more details on identity verification, please refer to Basic Introduction to Identity Verification;
2. Activate CDN/ECDN services;
Tencent Cloud CDN supports two service regions: within China and outside China, currently offering billing based on traffic per hour by default. For more explanations regarding billing rules, please refer to Billing Explanation.
After checking the unified service terms, click to activate the service, you can successfully start using CDN/ECDN services.
3. You must have a domain name and an accessible site
2. click on Domain Management in the left menu to enter the domain management list;
3. click Add Domain to add a new domain;
4. Configure the basic information for the acceleration domain:
Configuration Item
Description
Acceleration Region
You can choose the appropriate acceleration region based on your needs:
Within China: All users utilize Tencent Cloud's domestic nodes for nearby acceleration services; when selecting this acceleration region, the acceleration domain needs to be a registered domain;
Outside China: All users utilize Tencent Cloud's international nodes for nearby acceleration services, including Hong Kong (China) , Macao (China) , Taiwan (China) and other regions; when choosing this region, there are no requirements for the acceleration domain to be registered;
Global: All users are served by Tencent Cloud's global nodes for nearby services, when selecting this acceleration region, the acceleration domain needs to be a registered domain.
Note:
1. Based on your acceleration region, it is recommended that the origin server be located in the same region during origin server configuration. For example, if you are accelerating within Mainland China, the origin server should be within Mainland China. If it is set in Hong Kong (China) or other areas outside Mainland China, it may cause issues such as cross-border access failure and slow return. If your acceleration region is global, you can configure separate origin servers for domestic and international regions after adding the domain in the domain configuration.
3. If you have purchased a regional traffic package, please be aware of your user distribution. The regional traffic package cannot offset traffic generated across regions. For example, if you purchased a 500GB traffic package for North America, it can only offset traffic consumed by users accessing North American nodes. Traffic from users accessing South American nodes cannot be offset.
Acceleration Domain Name
Domain Length:
The length of the acceleration domain cannot exceed 81 characters
Domain Filing/Compliance Requirements:
1. If the acceleration region is within China or for global acceleration, the domain must be filed with the Ministry of Industry and Information Technology; if the acceleration region is overseas, domain filing is not required
2. Domain filing synchronization has a certain delay, which is expected to take 1 - 2 hours. Please wait 1 - 2 hours after the filing is completed before trying to add the domain again
3. The accelerated content accessed through CDN must comply with national laws and regulations. If domains*.example.com,*.a.example.com,b.a.example.com are accessed through CDN, and the domainb.a.example.com is blocked due to illegal content, then all matching domains*.example.com,*.a.example.com,b.a.example.com will be blocked.
Domain Format Requirements:
1. Support access for domains likeexample.com,a.b.example.com . After single domain access, the current acceleration configuration only takes effect for that domain. For example: if the access domain isexample.com, only user visits toexample.com have acceleration effects. Visits towww.example.com orm.example.com will not have acceleration effects. They need to independently access CDN to take effect.
2. The domain name can contain underscores (_) and Punycode-converted Chinese characters. You must obtain ICP filings for Chinese domain names before you convert the Chinese characters in the domain names to Punycode.
Wildcard Domain Format Requirements:
1. Support access for wildcard domains like*.example.com,*.a.example.com. When wildcard domains are accessed, their subdomains or secondary wildcard domains cannot be accessed from other accounts temporarily. For example: if the accessed wildcard domain is*.example.com, user visits to the domaina.example.com match the wildcard domain and are accelerated based on the wildcard domain configuration; user visits to the domainexample.com do not match the wildcard domain and are not accelerated
2. In the same account, multiple nested domains can be accessed, such as:*.example.com,*.path.example.com,a.path.example.com can be accessed simultaneously under the same account. Domain configuration and traffic statistics can be differentiated by priority. The more precise the match, the higher the priority. For example: visits toa.path.example.com will match the domain configuration ofa.path.example.com, visits tob.path.example.com will match the domain configuration of*.path.example.com, and visits toc.example.com will match the configuration of*.example.com. Traffic statistics follow the same logic.
3. If the wildcard domain you need to access currently includes a subdomain that has been accessed under another account, it is necessary to delete the corresponding subdomain under that account before it can be accessed under the current account. For example, if Account A has accessed the domain a.example.com, and Account B needs to access *.example.com, because *.example.com already includes the subdomain a.example.com, it is required to first delete a.example.com from Account A before it can be accessed under Account B as *.example.com;
Domain Ownership Verification:
When your domain account meets the following conditions, domain ownership verification is required. Verification methods can be referenced in Domain Ownership Verification:
1. When the domain is accessed for the first time, for example:a.example.com. After the domain is accessed, peer domains and subdomains likeb.example.com are regarded as authorized domains by default and can be accessed without verification. However, higher-level domains likeexample.com still require verification
2. If a subdomain has been added to another account, domain ownership verification is required to verify the current domain ownership. Once verified, you can reclaim the domain and add it to the current account
3. When adding a sibling wildcard domain, verification is needed. For example, if a.example.com is added, *.example.com still needs verification while *.a.example.com is a subordinate wildcard domain and can be added without verification.
Acceleration type
Acceleration types are mainly divided into CDN Static Acceleration and ECDN Whole Site Acceleration. You can choose the appropriate type according to the type of your current files:
Note:
1. CDN and ECDN use different billing methods respectively. The CDN Traffic Package is only applicable to offset the traffic cost generated by the CDN CDN , and not applicable to the ECDN ECDN. For more detailed comparisons and billing prices, please refer to the Product Documentation.
2. In some special cases, users are temporarily not allowed to switch acceleration types. Please choose the appropriate acceleration type carefully according to your business needs. If modification is required after configuration, you can delete the domain name and re-add it.
CDN CDN:
Suitable for static resource acceleration, static resources refer to cases where the origin server returns the same content when different users access the same resource multiple times. For example: html, css and js files, images, videos, software installation packages, apk files, compressed package files, etc.
You can choose the following segmented scenarios acceleration types to achieve optimal acceleration effects:
CDN Web Page Small Files: Applicable to e-commerce, websites, UGC communities, and other business scenarios that mainly involve small static resources such as webpage styles, images, and small files.
CDN Download Large Files: Applicable to business scenarios where large files such as game installation packages, application updates, and application program packages are downloaded.
CDN Audio and Video on Demand: Applicable to audio and video on-demand scenarios that require acceleration, such as online on-demand audio and video streaming.
ECDN Whole Site Acceleration:
Suitable for dynamic resource acceleration, dynamic resources refer to cases where the origin server returns different content when different users access the same resource multiple times. For example: API interfaces, .jsp, .asp, .php, .perl and .cgi files, etc.
You can choose the following segmented scenarios acceleration types to achieve optimal acceleration effects:
ECDN Dynamic and Static Acceleration: Applicable to business scenarios where dynamic and static data is integrated, such as various website homepages.
ECDN Dynamic Acceleration: Applicable to scenarios such as account log in, order transaction, API call, real-time query, etc.
IPv6 Access
IPv6 access is disabled by default. After you enable it, when a user's client uses the IPv6 protocol to initiate a request, CDN supports accessing CDN nodes via the IPv6 protocol. After adding the domain name, you can manually enable/disable this switch.
Note:
IPv6 access is only available in the Chinese mainland. For global acceleration domain names, if IPv6 access is enabled, it will take effect only in the Chinese mainland. For domain names with acceleration outside the Chinese mainland, it cannot be enabled.
Tag
Tag is used for categorizing and managing resources from different dimensions. If the existing Tag does not meet your needs, please go to the console manage Tag .
1. Up to 50 tags can be added
2. Only existing tags (tags already added in the Tag console) can be selected
3. When adding a tag, both the tag key and tag value are mandatory.
5. Configuring origin server basic information
origin server configuration options include proprietary source, COS source, and third-party COS, each with distinct configuration methods based on your needs. For proprietary sources, such as own servers or CVM server resources, you can choose a proprietary source as your origin server type, with the configuration as follows:
Configuration Item
Description
Origin-pull Protocol
HTTP: Origin fetch requests use HTTP requests. If the origin server port is not defined, the default port 80 is used for origin fetch. Please ensure that the origin server port 80 is open;
HTTPS: Origin fetch requests use HTTPS requests. If the origin server port is not defined, the default port 443 is used for origin fetch. Please ensure that the origin server port 443 is open. Currently, some platforms have not yet opened the option to define custom HTTPS origin fetch ports.
Follow Protocol: The origin-pull protocol follows the user's request protocol. For example, if the user's request uses HTTPS, the origin pull will also use HTTPS. When the origin-pull protocol is set to follow protocol, you cannot specify an origin-pull port to avoid request failures.
Origin server address
The origin server address allows users to enter the origin address, define the port, and origin server weight:
Origin Server Address: Supports entering domain names or IP addresses, with a maximum of 50 entries allowed
Custom Port: Users can specify the access port for origin-pull. If your origin server has not modified the access port number, you do not need to fill it in. CDN will use the default port based on the origin-pull protocol
Weight: When multiple origin servers are configured, you can assign a weight to each origin server. CDN will poll the origin servers according to their weights.
Note:
1. The origin server address cannot be the same as the acceleration domain name, or have Domain A pull from Domain B, and add Domain B to pull from Domain A, as this will cause a resolution loop and result in access errors
2. If your COS Origin or Third-party COS has public read/write access, you can also choose the origin server type as Self-owned Origin and use the COS Origin address or Third-party COS address for origin-pull.
When your origin server is COS origin, select the origin server type as COS origin. The configuration is as follows:
Configuration Item
Description
Origin-pull Protocol
HTTP: Use HTTP requests for COS origin requests;
HTTPS: Use HTTPS requests for COS origin requests. COS origin supports HTTPS access by default, it is recommended to choose HTTPS for origin requests;
Protocol Follow: Access COS origin according to the protocol of the user's request.
Origin server address
If the origin server is COS origin, CDN supports selecting the Tencent Cloud COS bucket name as the origin server through a dropdown menu and using fuzzy search for filtering.
1.When adding a bucket for the first time, click to authorize the CDN to access the bucket.
After agreeing to the authorization, click OK to complete the authorization
2.COS buckets are divided into Default Domain, Static Website Domain, and Global Acceleration Domain
Default Domain Name: The default bucket access domain name, which can be directly used to access the bucket ;
Static Website Domain Name: If the current bucket has enabled static website configuration, please use this domain name as the origin server address, otherwise the static website configuration may become invalid;
Global Acceleration Domain Name: If your current bucket has enabled global acceleration, please use this domain name as the origin address, otherwise the global acceleration configuration of the bucket may become invalid.
Note:
1. If your bucket is configured with cross-domain rules, configure the same cross-domain rules in the CDN HTTP response header to avoid cross-domain access issues
2. Currently, when using COS origin as the origin server, only one origin server is allowed.
Private bucket access
This feature is disabled by default. You can enable it if your COS bucket allows only private reads and writes. After you enable the feature, CDN automatically generates a valid access key for the origin-pull of files.
When your origin server is third-party COS and is configured for private read and write access, select the origin server type as third-party COS. The configuration is as follows:
Configuration Item
Description
Vendor Source
The following third-party object storage services are allowed: AWS S3, Alibaba Cloud OSS, Huawei Cloud OBS, and Qiniu Cloud kodo. The support for Huawei Cloud OBS and Qiniu Cloud kodo is still in canary testing. If you need to use one of the two options, contact Tencent Cloud engineers.
Origin-pull Protocol
You can select the origin-pull protocol based on the access protocol of the third-party COS:
HTTP: Use HTTP requests to pull resources from the third-party COS, using the default port 80;
HTTPS: Use HTTPS requests to pull resources from the third-party COS, using the default port 443.
Origin server address
Please enter a valid access address for the third-party COS. There are no strict format restrictions for this address in CDN, but please ensure that the address is accessible. Domain name address formats can refer to the following examples:
Qiniu Cloud Kodo: Custom access domain name, no fixed format.
Private bucket access
If your third-party COS access permission is private read and write, please enable private bucket access. After enabling it, you will also need to click below to enter the access key information
6.After configuration, click Add Domain to proceed to the Next.
Step 2. Use recommended configurations
After adding the domain name, you can configure your CDN in the recommended configuration section, based on different acceleration types, from four dimensions: improving resource hit rate, enhancing access performance, preventing overspending, and enhancing access security, to achieve the best acceleration effect.
If you don't need to perform recommended configurations, you can click to return to domain management, go back to the current domain list page, or click to skip, Next , to enter the third step configuration Cname page.
The recommended configuration section by default provides you with recommended configuration items and content, which you can modify according to actual needs. After clicking to submit the configuration, all settings will be submitted and proceed to Next .
CDN Small Web Files/CDN Large File Downloads/CDN audio and video on-demand/ECDN Dynamic and Static Acceleration
For content that does not frequently update, such as images and JS files, you can set a longer cache time to increase the resource hit rate at the nodes; dynamic files are not cached.
Note:
If your origin server resources need to be updated immediately on the CDN node, you can use the cache refresh feature to proactively update unexpired files on the CDN node. For more information, refer to: Cache Refresh
Recommended configuration (in order of priority, Rule 2 should have a higher priority than Rule 1):
1. All files cached for 30 days;
2. Files with the extensions php/jsp/asp/aspx will not be cached.
CDN Small Web Files/CDN Large File Downloads/CDN audio and video on-demand/ECDN Dynamic and Static Acceleration
CDN nodes can distinguish resource versions based on the URL parameters after the '?'. If the current resource does not use these parameters for versioning, ignoring these parameters can effectively improve resource hit rates.
Recommended configuration:
1. If the current resource uses '?parameters' for different versions, it is recommended not to ignore the parameters or to retain specific ones;
2. For resources not distinguished by '?parameters' for versions, it is recommended to enable the ignore parameters configuration by default.
CDN small web files/ECDN dynamic and static acceleration
Browser cache rules can store infrequently updated files in the user's browser to improve resource response speed.
Recommended configuration:
Specify the browser cache time for file extensions or directories that do not update frequently. For example: file extensions include jpg/png/gif/bmp/svg/webp images, with a browser cache time of 1 hour.
For dynamic acceleration types, caching files within the node may cause access errors or issues like being unable to log in. Therefore, it is recommended not to cache files in ECDN dynamic acceleration.
Recommended configuration: Set all files to no cache.
CDN small web files/ECDN dynamic and static acceleration
With the aid of smart compression, Tencent Cloud CDN can compress the returned resources with Gzip or Brotli according to set rules, which effectively reduces the size of transferred content and costs.
Recommended configuration:
CDN by default enables Gzip compression for files with extensions .js, .html, .css, .xml, .json, .shtml, .htm and sizes between 256 Bytes and 2MB. You can add file type configurations as needed.
CDN large file download/CDN audio and video on demand
If your files are mostly static large files, enabling Range GETs for origin retrieval can improve the response speed and distribution efficiency of large files.
Recommended configuration:
If your origin server supports range requests and your file size is larger than 4M, it is recommended to enable Range GETs.
CDN small web files/ECDN dynamic and static acceleration
When enabling 301/302 follow-ups, the Tencent Cloud CDN node will actively follow the redirection for the 301/302 status code returned from the origin server until the corresponding resource file is retrieved, without the need for the client to redirect the request manually, which can reduce link latency and improve response speed.
Recommended configuration:
It is recommended to enable this in the case of multiple link redirections.
Video dragging mainly occurs in VOD scenarios. After enabling this configuration, when a user drags the playback progress bar, nodes can directly respond to video drag requests. After enabling video dragging, the cache key rules need to be simultaneously configured to ignore all parameters
The HTTPS protocol is an encrypted and reliable transmission protocol, which effectively protects the security of your transmitted data. We recommended that you complete the HTTPS certificate configuration.
The IP access frequency limit configuration can help prevent malicious access to resources and APIs by single users. Adjust the limit based on actual needs. Note that this configuration cannot prevent DDoS attacks.
Recommended configuration:
It is recommended to enable it and adjust the frequency limit based on the actual traffic of your website.
Step 3. Configure a CNAME record
Configure a CNAME record
After adding the domain name, you need to configure a CNAME record to enable CDN acceleration. We offer two CNAME configuration methods. For more information, see Configure CNAME.
Verifying the effect of the CNAME record
1. After configuring the CNAME , you can click on 'Verify CNAME Status' in the third step of adding a domain name to check if the current domain's CNAME is effective. If the status shows as effective, the current CNAME resolution has correctly taken effect, and the domain has activated CDN acceleration. If the current status is not effective, you need to verify if the CNAME configuration is completed. If the CNAME is correctly configured and the issue might be a delay in resolution effectiveness, you can also opt for the third method of verification.
2. View the domain name list in the console. If the CNAME resolution shows a correct resolution prompt, then CDN acceleration for the domain is active. If there are two CNAME resolutions, only one needs to be effective.
3. You can also use the nslookup or dig commands to check the current domain's resolution effectiveness. If you are using the Windows system, open the cmd program in Windows. For example, for the domain name www.test.com, you can run the following command in cmd : nslookup -qt=cname www.test.com. Based on the results, you can check the domain's CNAME information. If it matches the CNAME address provided by Tencent Cloud CDN , the current CDN acceleration is effective.
If you use a Mac or Linux system, you can use the dig command for verification with the domain www.test.com. Run the command in the terminal: dig www.test.com. Check the CNAME information. If it matches the CNAME address provided by Tencent Cloud CDN, then the CDN acceleration is active.
Understanding Cache, Cache Purging, and Cache Prefetch
1. After adding the domain name, you can configure CDN caching based on your file types. CDN caching helps cache static files at edge nodes to respond to user requests quickly and reduce back-to-origin traffic. For details, see Node Cache Expiry Configuration.
2. Cache purging is mainly used when user files have been cached on a node, and new files are published or files violate certain rules. Users manually trigger cache purging to delete the cached resources on the node. For more information, see Purge Cache.
3. Cache preheating is mainly used when users have large or hot files accessed frequently. By preheating, the files can be cached in advance on Tencent Cloud CDN nodes to avoid origin access during user requests. This reduces back-to-origin traffic and improves user access experience. For more information, see Prefetch Cache.
FAQs
1. After domain access for example.com, does www.example.com have acceleration effect?
No, example.com and www.example.com are considered two separate domains. Both need to be added in the console for CDN acceleration effect.
2. After domain access for *.example.com, does example.com have acceleration effect?
No, if you add *.example.com, it only supports acceleration for domains like a.example.com and a.b.example.com. If the example.com domain also needs CDN acceleration, you need to add the domain example.com separately.