The Alibaba Cloud CDN service is mainly used to accelerate website access. In some cases, website access through Alibaba Cloud CDN slows down compared with direct access to the origin site.
The following content describes how to troubleshoot slow website access through Alibaba Cloud CDN.
The problem occurs frequently in the following two scenarios.
The cache hit rate is low, which may be caused by the following factors:
Improper cache configuration
Cache failure due to HTTP headers
Few files in cache because the Alibaba Cloud CDN domain is added only recently
Few cache content due to the type of the origin site
Low website access traffic, short expiration time, and few hit files
Website access in some areas is slow. Dynamic files are retrieved from the origin site at slow speed in some regions.
After files are cached by Alibaba Cloud CDN, the files are returned from Alibaba Cloud CDN at faster speed than from the origin site. When access to a website through Alibaba Cloud CDN is slow, perform the following operations to identify the cause:
Test whether domain name resolution is correct to ensure that your applications are successfully resolved to Alibaba Cloud CDN. To perform the test, ping the domain.
Access a website through the domain. Use F12 developer tools on the local PC and press Ctrl+F5 to refresh the page several times. Check whether static pages are cached based on the hit status of x-catch. Hit indicates that the pages are hit, whereas miss indicates that the pages are not cached. If the pages are not cached, identify the cause.
Check the loading time of cached static files, capture a screenshot, and mark the time.
Bind the domain name to the local hosts file. After binding, the domain name is resolved to the origin site. Use the developer tools and press Ctrl+F5 to refresh the page several times. Search for the file link you just viewed, pay attention to the time, and capture a screenshot. Send the two screenshots to the customer. The screenshots show that access to the origin site takes longer than access to the Alibaba Cloud CDN domain. The verification is complete.
If the problem persists, contact Alibaba Cloud After-Sales Technical Support.