How CDN Works
When a user accesses a website that uses CDN, the local DNS redirects the request to CDN using a CNAME record. Then, CDN finds the PoP that responds the fastest based on preset rules (including content types, geological locations, and network loads), and sends the PoP IP address to the user. With CDN, the user gets the requested content faster. The following figure shows the HTTP request process after CDN is used.
The HTTP request process is as follows:
- A user enters the domain name of a website (for example, www.example.com) in the browser. The browser sends a DNS request to the local DNS.
- The local DNS checks whether its cache includes the IP address of www.example.com. If yes, the local DNS returns the cached information to the user. If no, the local DNS sends a resolution request to the authoritative DNS.
- The authoritative DNS resolves the domain name. The domain name points to www.example.com.*.cdnhwcedi10.com (CNAME of the domain name).
- The local DNS redirects the request to the CDN service.
- CDN performs intelligent domain resolution, then provides the local DNS with the IP address of the CDN PoP which responds the fastest.
- The user's browser obtains the IP address of this CDN PoP.
- The user's browser sends the access request to this CDN PoP.
- If this CDN PoP has cached the content, it sends the desired resource to the user and ends the request.
- If this CDN PoP has not cached the content, it sends a request to the origin server to pull the content. CDN caches the origin content on this CDN PoP based on custom cache policies. Then, the PoP sends the desired content to the user and ends the request. For details about how to configure a cache policy, see Cache Rules.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.