Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to achieve cdn acceleration

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

After purchasing the CDN service, users will be more concerned about the actual effect in the process of using it. First of all, make sure that it has been activated successfully, and then follow the basic steps to add accelerated domain names and configure CNAME. After all, you can test whether the CDN acceleration is successful.

How to achieve cdn acceleration? Before describing the implementation principle of CDN, let's take a look at the access process of traditional uncached services in order to understand the difference between CDN cached access and uncached access:

The user submits the domain name → browser to interpret the domain name → to get the IP address of the destination host → sends a request according to the IP address access → gets the request data and replies

As you can see from the above, the process for a user to visit a website that does not use CDN caching is:

1) the user provides the domain name to be accessed to the browser

2) the browser calls the domain name resolution function library to resolve the domain name to get the corresponding IP address of the domain name

3) the browser uses the obtained IP address to send a data access request to the service host of the domain name

4) the browser displays the content of the web page according to the data returned by the host of the domain name.

Through the above four steps, the browser completes the whole process of receiving the domain name that the user wants to access from the user to obtaining data from the domain name service host. The CDN network adds a Cache layer between the user and the server. How to direct the user's request to the Cache to obtain the data of the source server is mainly achieved by taking over DNS. Let's take a look at the process of visiting the website cached by CDN:

Flow chart

From the figure above, we can see that after using the CDN cache, the visit process of the website becomes:

1) the user provides the domain name to be accessed to the browser

2) the browser calls the domain name resolution library to resolve the domain name. Because CDN adjusts the domain name resolution process, the resolution function library generally gets the CNAME record corresponding to the domain name. In order to get the actual IP address, the browser needs to parse the obtained CNAME domain name again to get the actual IP address. In this process, the global load balancing DNS parsing is used, such as parsing the corresponding IP address according to the geographical location information, so that the user can access it nearby.

3) the IP address of the CDN cache server is obtained by this parsing. After getting the actual IP address, the browser sends an access request to the cache server.

4) the cache server obtains the actual IP address of the domain name through Cache internal private DNS resolution according to the domain name to be accessed by the browser, and then the cache server submits the access request to the actual IP address

5) after the cache server gets the content from the actual IP address, on the one hand, it saves it locally for later use, on the other hand, it returns the obtained data to the client to complete the data service process.

6), after the client gets the data returned by the cache server, it displays it and completes the whole data request process of browsing.

From the above analysis, we can get that in order to be transparent to ordinary users (that is, after adding the cache, the user client does not need to make any settings, the user client can directly use the original domain name of the accelerated website to access, but also to provide accelerated services for the specified website while reducing the impact on ICP, as long as the domain name resolution part of the whole access process is modified to achieve transparent accelerated services.

The following is the specific operation process of CDN network implementation:

1) as an ICP, you only need to hand over the domain name interpretation to the CDN operator, without any modification in other aspects. During the operation, ICP modifies the resolution record of its domain name and generally points to the address of the Cache server on the CDN network by cname.

2) as a CDN operator, you first need to provide public resolution for the domain name of ICP. In order to implement sortlist, you usually point the interpretation result of ICP's domain name to a CNAME record.

3) when sortlist is needed, CDN operators can use DNS to specially handle the domain name resolution process pointed to by CNAME, so that the DNS server can return different IP addresses of the same domain name according to the client's IP address when it receives the client request.

4) because of the IP address obtained from cname and with hostname information, after the request arrives at Cache, Cache must know the IP address of the source server, so maintain an internal DNS server within the CDN operator to interpret the real IP address of the domain name accessed by the user

5) when maintaining the internal DNS server, you also need to maintain an authorization server to control which domain names can be cached and which are not, so as to avoid open proxies.

If there is anything else you don't understand, you can find our CDN technical engineer on the official website. CDN technical engineer has more than ten years of experience in the industry, so it will be more detailed and professional than the editor's answer. Official website link www.yisu.com

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report