Operation and Use of CDN | Learning Notes
1、 Activate CDN products
1. Log in to the Alibaba Cloud console and activate the CDN service. After real name authentication, you can activate the CDN service.
2. Adding an accelerated domain name mainly requires that the domain name be registered with the Ministry of Industry and Information Technology. The domain name or site must undergo real name authentication, either of which is indispensable. Alternatively, it is also possible to perform real name authentication before filing. At present, CDN provides a console and OpenAPI interface with the addition of a fast domain name.
3. Configure CNAME records in cloud resolution. When a user visits a site, they actually visit the CDN node, change the domain name resolution, and point the resolution to the "CNAME domain name" generated by the CDN system. This completes domain name acceleration access, and after setting it up, wait for the CDN to take effect. This is a process of activating CDN products.
2、 Configure CNAME
1. Obtain the CNAME value of the accelerated domain name
On the CDN management console, you will be prompted how many CNAME resolution records need to be configured. Log in to the CDN console and copy the CNAME value corresponding to the acceleration domain name.
2. Add CNAME record
Log in to the Domain Name System console to add a resolution.
First, click on the product to find the CDN inside, select Activate, and then log in to the management console. After logging in, you can see an overview of the overall data, bandwidth peak, total usage or HTTPS requests. Then, in the console, you can get a detailed overview of information, including the added domain name. You can click on Domain Name Management to see the domain name to be resolved. After successful creation, A CDN record will be generated and you can click to add a domain name. For example, if the domain name is test, you need to enter *. test.com. The prerequisite is that the domain name must be registered or authenticated by real name. When visiting a website, it will provide resolution or develop a domain name that needs to be resolved, set the business type, image small files, large file downloads, heavy rain 20 megabytes of large files, audio and video on demand, Or when you need to do other CDN acceleration.
CDN is not only about caching and acceleration, but also has security features. For example, if you want to achieve security acceleration now, it will be in a separate console, including live streaming media.
Choose the type of source site, such as www.test.com. This location actually allows users to download a file, and there are download locations on the website for users to download files. You can place frequently downloaded files in OSS, which can point to an Alibaba Cloud address. When returning to the source, the OSS domain name will be automatically accessed, but an IP address can also be specified, It can also support pointing to an origin site domain name. Selecting a port can specify the number of cached ports and select an accelerated region. If it must be filed in Chinese Mainland, if it is overseas, it does not need to be filed. If the domain name is legal, click Next, and you will see that the creation is complete in Alibaba Cloud. After the configuration is completed, you will be given a CNAME value. If the configuration is inappropriate, you can click Management, You can modify the configuration, IP address, return type, and active standby mode in the management.
At this point, you can copy the CNAME value accelerated by Alibaba Cloud's CDN. You need to create a resolution record for the CNAME, find the site on the cloud resolution management platform, select Add Record, select the record type CNAME, and the host is www. When accessing an external site, you can analyze the record value and paste the previously copied CNAME value. Click OK.
After successful configuration, various tools can be used to analyze the resolution record to see if it is normal. If the DNS cloud resolution status is not normal, it indicates that it needs to be filed. This is the process of creating domain names and adding CNAME resolution records.
3、 Create an accelerated domain name
1. Fill in the acceleration domain name
The domain name must be registered, otherwise it cannot be accessed.
2. Select Business Type
Image small files, large file downloads, audio and video on demand, etc.
3. Add Source Site Information
Configure the source site type, such as IP, which supports multiple server IPs. If the IP is filled in as the Alibaba Cloud ECS server IP, it can also be exempted from auditing. If you choose the source site domain name, you can choose multiple source site domain names, but the source site domain name cannot be the same as the acceleration domain name, port and acceleration area. If you choose 443 port, this requires a certificate, The accelerated regional selection in Chinese Mainland must be filed, otherwise it is abnormal to check the status on the console.
4、 Configure a back-to-source policy
When configuring the back-to-source strategy, priority can be selected, and the active/standby mode can be selected. Alibaba Cloud CDN can set multiple IPs and domain names as the source station, and each source station can have two priority levels: active and standby.
The back-to-source strategy is for users to receive 100% of their back-to-source traffic, passing through the priority based source site. If the source site loses response and fails three times in a row, the traffic will be redirected to the secondary priority based source site. Therefore, in the console, select Manage, modify the configuration, and add another node as a backup node. For example, in 1.1.1.1, when the node fails to respond, the health status is abnormal, It will switch to the backup node 2.2.2.2 to provide services. If the priority is the same, the CDN will automatically select, so the CDN will conduct a health check and actively check the health status of the source station every five seconds.
5、 Configure cache expiration time
1. This function can set cache server behavior for resources with different directory paths and file name suffixes.
2. Support user defined cache policy priority.
Users can customize the cache expiration time rules for specified resource content. The cache time mainly targets the suffix of the directory or file name, such as what type of file can set a cache expiration time, which allows users to customize. For example, for static files that are not frequently accessed or whose content is not frequently updated, the cache time can be set to one month, two months, or more. For static files that are updated very frequently, the cache time can be set to a shorter time, allowing users to customize their cache expiration rules. For some dynamic files, it is recommended to set the time to 0 and not cache them. For example, for PHP, the cache frequency is relatively low, You can set a lower cache time. In the CDN interface and cache configuration, you can set the expiration time of the cache, which can be based on cloud directories or file name suffixes. You can add and modify settings, such as filling in multiple suffixes, filling in jpg, or specifying an expiration time for a cache of type txt, such as 100 seconds or 100 hours, You can also set expired weight values, with a maximum weight value of 99 and a minimum weight value of 1. The larger the number, the higher the priority, and it will take effect first. For example, there are three weight values, 90, 70, and 80. The larger the number, it will take effect first, so it will take effect first, and then 80 will take effect, followed by 70.
3. The default cache policy for Cache.
6、 Refresh Cache
1. The source site content update requires updating the cache of the CDN node to ensure consistency between the source site content and the CDN cache content.
2. At present, the [Refresh] page of the CDN control management backend provides two refresh methods for customers to use.
(1) URL Refresh
Force certain files on the CDN CACHE node to be set as expired in order to achieve the goal of updating back to the source. The same ID can only refresh 2000 URLs per day.
(2) Catalog Refresh
Force the files in a directory on the CDN CACHE node to be set as expired, in order to achieve the goal of updating back to the source.
Select Refresh, select the operation type and select Refresh. The refresh type can be URL and directory refresh. Directory refresh is suitable for scenarios with a large amount of content. Directory refresh can submit up to 100 refresh requests per day, starting with HTTP. The content can be manually entered or uploaded in batches to update the cached content in real-time after the cache expires,
7、 View real-time monitoring data
1. Log in to the CDN console, enter the domain name management page, select the domain name you want to set, and click Manage.
2. In Data Monitoring>Resource Monitoring or Real Time Monitoring, select the monitoring items and indicators that the user wants to view and click Query.
By using legends and traffic graphs, users can more intuitively see the entire CDN situation. By clicking on data monitoring, real-time monitoring, and selecting the resource monitoring label or real-time monitoring label, they can see the flow back to the source, the quality of the flow, the quality of one hour, the quality of the 6-hour Hujiaxin, and basic data such as how many requests have been made, and the throughput.
Alternatively, you can choose resource monitoring, which involves monitoring resources, such as the area to be monitored, which domain name to monitor, and selecting the corresponding label. For example, by selecting an operational interface, you can detect a usage of the entire bandwidth or traffic, which is more intuitive for users.
8、 Using the anti-theft chain function
1. The anti-theft chain function is based on the referer mechanism supported by the HTTP protocol, which tracks the source through the referer and identifies and judges the source.
2. At present, the anti-theft chain function supports a blacklist or whitelist mechanism. After a visitor requests a resource, the request arrives at the CDN node. The CDN node will filter the visitor's identity based on the user's preset anti-theft chain blacklist or whitelist. Set up a whitelist and blacklist. If it does not meet the request, will the browser return the corresponding error for 403? You can click on access control in the domain name management, and the referer anti-theft chain can set up a whitelist and blacklist, allowing it to access the CDN or not, thus achieving the function of anti-theft chain.
9、 Validate CDN services
There are several methods to verify whether the CDN service has taken effect:
1. The acceleration domain name added through the ping or dig command, if successful, indicates that the CDN function has taken effect.
2. By using the dig command, you can view basic information such as the IP address and delay packet loss of the corresponding accelerated domain name accessing CDN nodes
3. Users can also obtain the response header of resources corresponding to the acceleration domain name to check if there is CDN acceleration corresponding node information to determine whether the CDN is effective.
You can choose CDN Domain Name Management, which has a tool that can detect whether it is the IP address of an Alibaba Cloud node. You can also visit a certain page to diagnose and see if the resolution is successful during page access.
You can use the most traditional CMD method to spell out the address of cloud resolution, see if it points to CName, and access the domain name. At this point, it points the resolution to the set CName record, which is already in the management console of the CDN and points to the resolution record. In the management interface, when accessing the CDN, what is the IP of the origin type, which actually points to this IP, At this point, verify whether the CDN is effective through corresponding methods.
10、 Introduction to other functions
1. Performance optimization:
Intelligent compression and page optimization.
2. Statistical analysis:
Statistics and analysis can be conducted on resources, including regions, operators, and URLs.
3. Picture Yellow:
Image yellow recognition is a controversial service in CDN acceleration. When users activate this service, they will automatically detect whether CDN images are related to yellow during the process of using CDN. Images related to yellow will be recorded for easy export or deletion by users,
4. Log management:
Log management provides downloads, transfers, real-time logs, and more.
Through these operations, you can learn how to configure and use CDN, which includes configuring a return source, refresh time, CName, and so on, to enjoy the acceleration services of Alibaba Cloud CDN.
1. Log in to the Alibaba Cloud console and activate the CDN service. After real name authentication, you can activate the CDN service.
2. Adding an accelerated domain name mainly requires that the domain name be registered with the Ministry of Industry and Information Technology. The domain name or site must undergo real name authentication, either of which is indispensable. Alternatively, it is also possible to perform real name authentication before filing. At present, CDN provides a console and OpenAPI interface with the addition of a fast domain name.
3. Configure CNAME records in cloud resolution. When a user visits a site, they actually visit the CDN node, change the domain name resolution, and point the resolution to the "CNAME domain name" generated by the CDN system. This completes domain name acceleration access, and after setting it up, wait for the CDN to take effect. This is a process of activating CDN products.
2、 Configure CNAME
1. Obtain the CNAME value of the accelerated domain name
On the CDN management console, you will be prompted how many CNAME resolution records need to be configured. Log in to the CDN console and copy the CNAME value corresponding to the acceleration domain name.
2. Add CNAME record
Log in to the Domain Name System console to add a resolution.
First, click on the product to find the CDN inside, select Activate, and then log in to the management console. After logging in, you can see an overview of the overall data, bandwidth peak, total usage or HTTPS requests. Then, in the console, you can get a detailed overview of information, including the added domain name. You can click on Domain Name Management to see the domain name to be resolved. After successful creation, A CDN record will be generated and you can click to add a domain name. For example, if the domain name is test, you need to enter *. test.com. The prerequisite is that the domain name must be registered or authenticated by real name. When visiting a website, it will provide resolution or develop a domain name that needs to be resolved, set the business type, image small files, large file downloads, heavy rain 20 megabytes of large files, audio and video on demand, Or when you need to do other CDN acceleration.
CDN is not only about caching and acceleration, but also has security features. For example, if you want to achieve security acceleration now, it will be in a separate console, including live streaming media.
Choose the type of source site, such as www.test.com. This location actually allows users to download a file, and there are download locations on the website for users to download files. You can place frequently downloaded files in OSS, which can point to an Alibaba Cloud address. When returning to the source, the OSS domain name will be automatically accessed, but an IP address can also be specified, It can also support pointing to an origin site domain name. Selecting a port can specify the number of cached ports and select an accelerated region. If it must be filed in Chinese Mainland, if it is overseas, it does not need to be filed. If the domain name is legal, click Next, and you will see that the creation is complete in Alibaba Cloud. After the configuration is completed, you will be given a CNAME value. If the configuration is inappropriate, you can click Management, You can modify the configuration, IP address, return type, and active standby mode in the management.
At this point, you can copy the CNAME value accelerated by Alibaba Cloud's CDN. You need to create a resolution record for the CNAME, find the site on the cloud resolution management platform, select Add Record, select the record type CNAME, and the host is www. When accessing an external site, you can analyze the record value and paste the previously copied CNAME value. Click OK.
After successful configuration, various tools can be used to analyze the resolution record to see if it is normal. If the DNS cloud resolution status is not normal, it indicates that it needs to be filed. This is the process of creating domain names and adding CNAME resolution records.
3、 Create an accelerated domain name
1. Fill in the acceleration domain name
The domain name must be registered, otherwise it cannot be accessed.
2. Select Business Type
Image small files, large file downloads, audio and video on demand, etc.
3. Add Source Site Information
Configure the source site type, such as IP, which supports multiple server IPs. If the IP is filled in as the Alibaba Cloud ECS server IP, it can also be exempted from auditing. If you choose the source site domain name, you can choose multiple source site domain names, but the source site domain name cannot be the same as the acceleration domain name, port and acceleration area. If you choose 443 port, this requires a certificate, The accelerated regional selection in Chinese Mainland must be filed, otherwise it is abnormal to check the status on the console.
4、 Configure a back-to-source policy
When configuring the back-to-source strategy, priority can be selected, and the active/standby mode can be selected. Alibaba Cloud CDN can set multiple IPs and domain names as the source station, and each source station can have two priority levels: active and standby.
The back-to-source strategy is for users to receive 100% of their back-to-source traffic, passing through the priority based source site. If the source site loses response and fails three times in a row, the traffic will be redirected to the secondary priority based source site. Therefore, in the console, select Manage, modify the configuration, and add another node as a backup node. For example, in 1.1.1.1, when the node fails to respond, the health status is abnormal, It will switch to the backup node 2.2.2.2 to provide services. If the priority is the same, the CDN will automatically select, so the CDN will conduct a health check and actively check the health status of the source station every five seconds.
5、 Configure cache expiration time
1. This function can set cache server behavior for resources with different directory paths and file name suffixes.
2. Support user defined cache policy priority.
Users can customize the cache expiration time rules for specified resource content. The cache time mainly targets the suffix of the directory or file name, such as what type of file can set a cache expiration time, which allows users to customize. For example, for static files that are not frequently accessed or whose content is not frequently updated, the cache time can be set to one month, two months, or more. For static files that are updated very frequently, the cache time can be set to a shorter time, allowing users to customize their cache expiration rules. For some dynamic files, it is recommended to set the time to 0 and not cache them. For example, for PHP, the cache frequency is relatively low, You can set a lower cache time. In the CDN interface and cache configuration, you can set the expiration time of the cache, which can be based on cloud directories or file name suffixes. You can add and modify settings, such as filling in multiple suffixes, filling in jpg, or specifying an expiration time for a cache of type txt, such as 100 seconds or 100 hours, You can also set expired weight values, with a maximum weight value of 99 and a minimum weight value of 1. The larger the number, the higher the priority, and it will take effect first. For example, there are three weight values, 90, 70, and 80. The larger the number, it will take effect first, so it will take effect first, and then 80 will take effect, followed by 70.
3. The default cache policy for Cache.
6、 Refresh Cache
1. The source site content update requires updating the cache of the CDN node to ensure consistency between the source site content and the CDN cache content.
2. At present, the [Refresh] page of the CDN control management backend provides two refresh methods for customers to use.
(1) URL Refresh
Force certain files on the CDN CACHE node to be set as expired in order to achieve the goal of updating back to the source. The same ID can only refresh 2000 URLs per day.
(2) Catalog Refresh
Force the files in a directory on the CDN CACHE node to be set as expired, in order to achieve the goal of updating back to the source.
Select Refresh, select the operation type and select Refresh. The refresh type can be URL and directory refresh. Directory refresh is suitable for scenarios with a large amount of content. Directory refresh can submit up to 100 refresh requests per day, starting with HTTP. The content can be manually entered or uploaded in batches to update the cached content in real-time after the cache expires,
7、 View real-time monitoring data
1. Log in to the CDN console, enter the domain name management page, select the domain name you want to set, and click Manage.
2. In Data Monitoring>Resource Monitoring or Real Time Monitoring, select the monitoring items and indicators that the user wants to view and click Query.
By using legends and traffic graphs, users can more intuitively see the entire CDN situation. By clicking on data monitoring, real-time monitoring, and selecting the resource monitoring label or real-time monitoring label, they can see the flow back to the source, the quality of the flow, the quality of one hour, the quality of the 6-hour Hujiaxin, and basic data such as how many requests have been made, and the throughput.
Alternatively, you can choose resource monitoring, which involves monitoring resources, such as the area to be monitored, which domain name to monitor, and selecting the corresponding label. For example, by selecting an operational interface, you can detect a usage of the entire bandwidth or traffic, which is more intuitive for users.
8、 Using the anti-theft chain function
1. The anti-theft chain function is based on the referer mechanism supported by the HTTP protocol, which tracks the source through the referer and identifies and judges the source.
2. At present, the anti-theft chain function supports a blacklist or whitelist mechanism. After a visitor requests a resource, the request arrives at the CDN node. The CDN node will filter the visitor's identity based on the user's preset anti-theft chain blacklist or whitelist. Set up a whitelist and blacklist. If it does not meet the request, will the browser return the corresponding error for 403? You can click on access control in the domain name management, and the referer anti-theft chain can set up a whitelist and blacklist, allowing it to access the CDN or not, thus achieving the function of anti-theft chain.
9、 Validate CDN services
There are several methods to verify whether the CDN service has taken effect:
1. The acceleration domain name added through the ping or dig command, if successful, indicates that the CDN function has taken effect.
2. By using the dig command, you can view basic information such as the IP address and delay packet loss of the corresponding accelerated domain name accessing CDN nodes
3. Users can also obtain the response header of resources corresponding to the acceleration domain name to check if there is CDN acceleration corresponding node information to determine whether the CDN is effective.
You can choose CDN Domain Name Management, which has a tool that can detect whether it is the IP address of an Alibaba Cloud node. You can also visit a certain page to diagnose and see if the resolution is successful during page access.
You can use the most traditional CMD method to spell out the address of cloud resolution, see if it points to CName, and access the domain name. At this point, it points the resolution to the set CName record, which is already in the management console of the CDN and points to the resolution record. In the management interface, when accessing the CDN, what is the IP of the origin type, which actually points to this IP, At this point, verify whether the CDN is effective through corresponding methods.
10、 Introduction to other functions
1. Performance optimization:
Intelligent compression and page optimization.
2. Statistical analysis:
Statistics and analysis can be conducted on resources, including regions, operators, and URLs.
3. Picture Yellow:
Image yellow recognition is a controversial service in CDN acceleration. When users activate this service, they will automatically detect whether CDN images are related to yellow during the process of using CDN. Images related to yellow will be recorded for easy export or deletion by users,
4. Log management:
Log management provides downloads, transfers, real-time logs, and more.
Through these operations, you can learn how to configure and use CDN, which includes configuring a return source, refresh time, CName, and so on, to enjoy the acceleration services of Alibaba Cloud CDN.
Related Articles
-
A detailed explanation of Hadoop core architecture HDFS
Knowledge Base Team
-
What Does IOT Mean
Knowledge Base Team
-
6 Optional Technologies for Data Storage
Knowledge Base Team
-
What Is Blockchain Technology
Knowledge Base Team
Explore More Special Offers
-
Short Message Service(SMS) & Mail Service
50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00