1、 What is Refresh?
Refresh refers to eliminating old files on a cdn node and retrieving a new version of the file.
2、 What is preheat?
The first published file is actively pushed from the source site to the CDN, allowing users to access the CDN without having to hit the customer’s source site.
3、 Why refresh?
The resources cached on the CDN node have not expired, but based on the customer’s business requirements, the cache resources on the CDN node need to be updated. When encountering this scenario, the refresh function is launched, which forcibly deletes the cached content of the CDN node. When a user requests these resources, the CDN node needs to pull resources back to the source to ensure that the responding resources are consistent with the source station.
Common scenarios: For example, after the game package of Company A is released, it is found that there are bugs that need to be fixed. To reduce the impact, it is necessary to delete all the old game installation packages cached on the CDN node.
Refresh types are divided into directory refresh and URL refresh. URL refresh directly deletes cached resources on a node. For directory refresh, the file resources on the node will be expired, and the Last Modified time will be compared with the same source site. For example, the Last Modified time of the directory file on the node is: Mon, 26 Dec 2022 11:11:00 GMT, and the Last Modified time of the source site file is Mon, 28 Dec 2022 11:11:11:00 GMT. At this time, the source site will tell the node: Your file is older than mine, and I have updated the file. Come and retrieve the latest resources quickly, At this point, the new resources from the source site will be updated to the node. Otherwise, the source site will return 304, telling the node that the resources on your node have been consistent with the resources on my source site, and they are up to date. There is no need to update them.
4、 Why Preheat?
Actively push from the origin to the CDN, allowing users to access the CDN without returning to the customer’s origin hit.
“The xx game was first developed on September 12th, and domestic game players have long been eager to wait for the service to be opened. When they rush to open the service, they quickly download the game client.”. If there is no warm-up, when the first batch of players visit the official website to download, the official website CNME records will be parsed to the CDN. Since this is the first access and there is no cache in the CDN, it is necessary to go back to the origin site to obtain the game client.
This will result in a poor user experience for the first batch of downloads, as all access to the origin host is centralized, and the CPU utilization and bandwidth of the origin host will run very high. After the first batch of players download, they can also cache a copy in the CDN, and the second batch of players download directly in the CDN, which is much faster than the first batch. However, after the CDN caches a complete game client, it may take half a day to a day to pass. Due to the high pressure on the origin site during the first batch of downloads, the bandwidth for CDN to return to the source may only be a few kilobytes, and downloading 2GB files at a speed of a few kilobytes may take several days. In the first few days after the game was launched, even the game client could not be downloaded.
Before starting a service, the game installation package is pushed from the source station to each CDN node through the warm-up function, and cached in advance. When opening the service, the first player can quickly obtain the game installation package from the CDN.