CDN of advanced knowledge system you can’t help but know

Time:2021-12-4

Basic concepts of CDN

CDN (content delivery network) isContent distribution network, is an intelligent virtual network based on the existing network. Relying on edge servers deployed in various places, throughCloth storageload balancing . of network requestsredirectandContent managementAnd other functional modules to judge the proximity and server load to ensure that the content provides the required resources for user requests in an extremely efficient way. Look at the picture first:

No CDN

CDN of advanced knowledge system you can't help but know

With CDN

CDN of advanced knowledge system you can't help but know

Role / benefits / advantages and disadvantages of CDN

1. Accelerate access and improve user experience

CDN can enable users to obtain the required resources nearby, reduce network congestion, and improve user access response speed and hit rate

2. Favorable search ranking and transformation

Website opening speed is an important indicator affecting website ranking. Faster website opening speed using CDN is conducive to search engine ranking and reduce jump out rate, which is conducive to website conversion rate and sales volume

3. Reduce the pressure on the origin server

The problem of server overload caused by excessive concurrency of the website is solved, which reduces the access pressure of the source server, saves the backbone network bandwidth, and can receive more traffic, so as to improve the performance, scalability and security of the website

4. Troubleshooting downtime

When an intentional plug-in (overload, attack, etc.) occurs to a CDN server, it will not affect all. The system will call the adjacent healthy CDN server node to continue the service, so as to have higher stability

5. Ensure website security

It is equivalent to adding an umbrella to the website, which can effectively attack most network attacks (DDoS, etc.), and the website will only hit the CDN node when attacked, without affecting the source server; In terms of content security, it can also solve the problem that pirated websites steal content through theft chains and other methods

6. Cost saving

The use of VPS or the purchase of servers to host websites has bandwidth limitations. Using CDN does not need to consider the purchase of servers and subsequent hosting operation and maintenance, image synchronization between servers, or labor for the management and maintenance of technicians, which reduces the cost of website construction and maintenance and saves manpower, energy and financial resources

shortcoming

Because the CDN adopts the caching mechanism of each node, for example, after the static web pages and pictures of the website are modified, the CDN cache is not updated in time, and the old web pages are still seen. Even if users use Ctrl + F5 in the browser to invalidate the browser side cache, users will still see old web pages because the CDN edge node does not synchronize the latest data. I usually log in to the server management background to refresh the CDN or call the O & M to refresh

Workflow and access principle of CDN

When CDN is enabled for a domain name, add a CDN specific resolution record to the background of the DNS resolution setting of the domain name. This resolution record will point to a CDN network specific server for processing DNS requests after the domain name is resolved. And set the IP address of the original web server (source station) corresponding to the domain name in the background of CDN

  1. After entering the URL, it will be resolved by local DNS first. The DNS system will give the domain name resolution right to the CDN server that handles DNS requests
  2. This CDN server will return the IP address of the CDN load balancing server
  3. When the browser accesses this load balancing server, the server will find a CDN server suitable for providing services under various conditions in the CDN network according to the browser’s network address, and return the IP address to the browser
  4. After the browser receives it, it accesses the CDN server and requests the file resources in the website
  5. If there is no relevant (no cache) website file on this server, pull it from the upper cache server in the CDN network. If there is still no upper cache server, continue to look up. If you can’t find it all the time, finally pull the website file from the source site, that isBack to source
  6. Then make a cache on the CDN server that can’t be found in each layer just now
  7. Finally, the CDN server designated to provide services for you sends the website file to the browser and opens the website

If other devices also use it to obtain the resource files of the website, they can directly return the corresponding file data on the cached CDN server. It is not necessary to pull from the source every time. This is the basic working mechanism of the CDN distribution network

User access comes first from the client or browser, and there will also be a layer of cache (strong cache). As we all know, the browser cache follows the standard HTTP protocol. After specifying the header, it will become invalid at the time. Therefore, when the source station returns to the CDN, we can addCache-Control:max-age=60In the protocol header, the CDN will be transmitted to the browser intact, so that the browser can realize cache invalidation within 1 minute and pull new resources back to the CDN.

Application scenarios of CDN

CDN technology is widely used in various scenarios of the Internet, such as picture small file, large file download, game acceleration, video and audio on demand, live streaming media, whole station acceleration, security acceleration, etc. Only the pure intranet software development and deployment scenarios do not need to use CDN (PS: there are also scenarios that need CDN in the intranet, such as large content applications such as telecom IPTV, mobile Ott, radio and television digital TV, and the services belong to the wide area network.)

1. Website / application acceleration

For the accelerated distribution of a large number of static resources in a site or application, it is recommended to separate the dynamic and static contents of the site. Dynamic files can be combined with ECS, static resources such as various types of pictures, HTML, CSS and JS files. It is recommended to store a large number of static resources in combination with object storage OSS, which can effectively accelerate the content loading speed and easily distribute website pictures, short videos and other contents

2. Video and audio on demand / large file download and distribution acceleration

It supports the download and distribution of various files and online on-demand acceleration services, such as MP4 and flv video files. The main business scenarios are video and audio on demand and large file download (such as installation package download). It is recommended to use it with object storage OSS, which can improve the return speed and save nearly 2 / 3 of the return bandwidth cost

3. Video live broadcast acceleration

Video streaming media live broadcast service supports an integrated solution for media resource storage, slice transcoding, access authentication and content distribution acceleration. Combined with elastic scaling service, timely adjust the server bandwidth to deal with sudden access traffic; Combined with media transcoding service, enjoy high-speed and stable parallel transcoding, and seamlessly expand the task scale

4. Mobile application acceleration

Distribution of mobile app update files (APK files), optimization and accelerated distribution of pictures, pages, short videos, UGC and other contents in mobile app. Provide httpdns service to avoid DNS hijacking and obtain real-time and accurate DNS resolution results, effectively shorten user access time and improve user experience

In which cases is CDN recommended

  • Generally speaking, websites focusing on information and content have certain access volume, such as information websites, government organization websites, industry platform websites, shopping malls and other websites focusing on dynamic content, forums, blogs, making friends, SNS, online games, search / query, finance, etc.
  • Provide website software developers, content service providers, online game operators, source code downloads, etc.
  • Websites with a large number of streaming media on demand applications include telecom operators, content service providers, sports channels, broadband channels, online education, video blogs, etc

What situations do not apply to CDN

  • Targeted, specific and serving a small number of users
  • Localized user base for a given geographical region
  • User data is sensitive, data jurisdiction is limited, and there are regulatory and complex governance requirements

Is CDN acceleration for the server where the website is located or for its domain name

CDN is to accelerate only a specific domain name of the website. If the same website has multiple domain names, visitors can access the domain names that have joined the CDN to obtain the acceleration effect, access the domain names that have not joined the CDN, or directly access the IP address, they can not obtain the CDN effect

Can CDN not cache some web pages and pictures with high timeliness requirements

Just use dynamic pages, ASP, PHP, JSP and other dynamic technologies. The pages made of dynamic technologies are not cached by CDN and do not need to be refreshed every time. Or use a website with two domain names, one with CDN enabled and the other without CDN. The pages and pictures with high requirements for timeliness are placed under the domain name without CDN

What are the advantages of CDN and mirror sites

CDN is completely transparent to the visitors of the website. There is no need for visitors to manually select the mirror site to visit, which ensures the friendliness of the website to visitors. CDN checks the availability of each node, and unqualified nodes will be picked out at the first time, thus ensuring a very high availability, which cannot be achieved by the mirror site. CDN deployment is simple, and it can take effect without making any changes to the original station

What are the advantages of CDN compared with double line computer room

The common two-wire computer room can only solve the problem of slow mutual access between Netcom and Telecom, and the problem of interworking with other ISPs (such as education network, mobile network and Tietong) has not been solved. The CDN is for visitors to get data nearby, and the nodes of the CDN are all over ISPs, so as to ensure the access speed from the website to any ISP. In addition, because of the principle of traffic shunting to each node, CDN naturally obtains the ability to resist network attacks

epilogue

Praise and support, leave a lingering fragrance, and be proud

reference resources

What is CDN? What are the advantages of using CDN- Know

Recommended Today

Hive built-in function summary

1. Related help operation functions View built-in functions: Show functions; Display function details: desc function ABS; Display function extension information: desc function extended concat; 2. Learn the ultimate mental method of built-in function Step 1: carefully read all the functions of the show functions command to establish an overall understanding and impression Step 2: use […]