advantages
(1) Cache resources
(2) hosting static resources to CDN can make access to resources accelerate
(3) Source websites reduce load , so they are less likely to be attacked by DDOS
principle
CDN server = caching + DNS load balancer
after accessing the resource for the first time, the data of the origin server will be cached in the CDN server. The next time users need to access the node, they will directly find the data in the cache node of CDN.
store the hot data on CDN before accessing the resource for the first time. This is called "resource preheating" to prevent the first access to the origin server to bear a large number of requests at one time. Otherwise, the origin server will probably hang up
use skills
1
use max-age for caching settings. The default settings are proxy server caching time and local caching time. If we don"t want the CDN server to cache for too long, we can use s-maxage to set it, which will overwrite the max-age. This can effectively avoid the generation of dirty data
2
if the static resources you host on CDN change frequently, don"t host them on CDN
3x-cache-lookup
if hit, upstream is included in the value, it does not hit
.4md5
excuse me: what the heck is this? we always use it in our projects, but we still don"t know what it is
.-Thank you ezmo for the answer-
md5
is the version number. Some of the
used to refresh the cache prevent malicious origin-pull. An agreement has been reached with CDN that each request CDN will carry some information back to the origin after MD5 encryption. In this way, even if the hacker sniffs the source IP, and parses the past directly, it cannot be used normally. (those who shoot the cloud again have this feature, you can check it out.)
some verify whether the request link has been changed.
has a sense of pure presence
, most of which are used to identify the cache