Help Center/ Content Delivery Network/ Troubleshooting/ Why Is It Still Slow to Access a Domain Name That Has Been Added for CDN Acceleration?
Updated on 2024-04-17 GMT+08:00

Why Is It Still Slow to Access a Domain Name That Has Been Added for CDN Acceleration?

Symptom

After CDN acceleration is enabled, access to a web page or app resources is still slow.

Check Items

  • Whether CDN acceleration is enabled for the domain name
  • Whether the CDN cache is hit
  • Whether inter-carrier or cross-province access is involved
  • Whether cache rules are properly configured
  • Whether the content is prefetched
  • Whether the client network is faulty

Procedure

  1. Check whether CDN acceleration is enabled for the domain name.

    If you have just added an acceleration domain name on the CDN console and are testing the domain name before adding a CNAME record, skip this step and configure the domain name as instructed in Getting Started.

    Check whether the domain name is resolved to CDN. Take the Windows operating system as an example. Open the Command Prompt and run the following command:

    nslookup -qt=cname Acceleration domain name

    If the command output contains .cdnhwcedi10.com, the CNAME record has taken effect.

    • If the command output does not contain .cdnhwcedi10.com, CDN acceleration has not taken effect for the added domain name. The CNAME record has not been added to your domain's DNS records. Contact your DNS service provider to configure the CNAME record as instructed in Configuring a CNAME Record.
    • If the CNAME record has been correctly configured, check the TTL of the previous resolution record of the domain name on the same resolution line. The TTL specifies the cache duration of a resolution record on the local DNS server. The newly added CDN CNAME record takes effect only after the TTL of the previous record expires.
  2. Check whether the CDN cache is hit.
    On the Google Chrome browser, press F12 and click the Network tab. View the response headers of the URL of a specific resource and perform the following operations:
    • If the value of the x-hcs-proxy-type header is 1, the cache is hit. If the value is 0, the cache is not hit.

    If no cache is hit, go to 3 to check the cache rule settings.

    If the cache is hit, proceed to the next step.

  3. Check cache rules.
    • Check whether the configured TTL is 0 or a small value. If CDN does not cache content or the TTL is too short, CDN has to frequently pull content from the origin server, and the origin pull cannot be accelerated.
    • Check the cache settings on the origin server. If no-cache, private, or no-store is configured on the origin server and Origin Cache Control is enabled on the CDN console (this function is disabled by default), CDN cannot cache content. CDN needs to pull content from the origin server, and the origin pull cannot be accelerated.
    • Check the priority of cache rules. The greater the value, the higher the priority.
    • Check whether URL parameters are retained. If URL parameters are retained, when users request a file using URLs containing different parameters, CDN considers that each request is new, and pulls the file from the origin server for each request. For details, see Cache Rules.
    • For more cache settings, see Setting the Cache TTL.
  4. Check whether the content is prefetched.

    If the content has not been prefetched and is requested for the first time, CDN PoPs will pull it from the origin server. In this case, slow access to the content is normal.

    When enabling CDN for the first time, you can prefetch large files or videos.

  5. Check the client network.

    Ping the domain name to which access is still slow after CDN acceleration to check the network delay and packet loss. If the network delay is long or severe packet loss occurs, check the network connection of the client.

If the fault persists even after taking the previous steps, submit a service ticket.