All Products
Search
Document Center

CDN:Purge and prefetch troubleshooting guide

Last Updated:Oct 21, 2026

This topic describes how to troubleshoot purge or prefetch tasks that cannot be submitted, content that remains abnormal after a purge, tasks that do not complete, or prefetch results that do not meet expectations.

Determine whether a purge or prefetch task succeeded

Successful task submission, task completion, and a cache hit for the current request are three different states that you must verify separately. Before you troubleshoot, record the task type, submission time, full URL, task ID, and console error message.

Important: Once a purge or prefetch task is successfully submitted, it cannot be canceled. Before you submit or resubmit a task, verify the URL list, task type, and scope. For prefetch tasks, also evaluate the capacity of the origin. Stopping the client script or closing the console page does not cancel a submitted task.

  1. Check the task status: In the operation records of the CDN console, verify that the task exists, its status is Completed, and its progress is 100%. If the task does not appear, it might not have been submitted successfully. If a task remains incomplete for a long time or shows a failed status, continue checking the task execution status.

  2. Check the origin status: Bypass CDN and access the corresponding origin resource. Verify that the origin returns the expected content and response headers, and record the status code, response content, Last-Modified, ETag, and Cache-Control. If an origin Host, protocol, port, or URL rewrite is configured, verify the resource based on the actual origin fetch configuration, including the corresponding path and query parameters. If the origin still returns outdated content or an abnormal response, fix the origin first.

  3. Check the CDN response: Access the accelerated URL with the actual service request method. Record the status code, response content, and response headers such as Age, Via, and X-Cache, and compare them with the origin results. HIT or MISS reflects only the current request and cannot independently prove that a particular task succeeded or failed.

  4. Eliminate client caching: Access the URL again in private browsing mode or after you clear the browser cache. Purging the CDN cache does not clear browser, proxy, or other client caches.

A task cannot be submitted

Based on the error message returned by the console or API, check the input format, permissions, and quotas in sequence.

How do I resolve a URL format error or an unsupported task type when submitting a purge or prefetch task?

  1. Make sure that you enter a complete HTTP or HTTPS URL under an accelerated domain name, not an origin URL. Enter one URL on each line. Do not join multiple URLs with commas.

  2. If a URL contains Chinese characters, spaces, or other non-ASCII characters, percent-encode it using UTF-8 first. Do not encode an already encoded percent sequence again.

  3. Prefetch supports only specific file URLs, not directories. A directory URL must end with /, but you can use it only for directory purges.

  4. If you use URL signing, parameter ignoring, a custom cache key, or URL rewrite, make sure that the submitted URL matches the actual cache key rules.

For the input requirements of each task type, see Procedure.

How do I resolve an exceeded quota, a rate limit, or a full queue when submitting a purge or prefetch task?

  1. Check quota limits: The per-submission limit controls the number of URLs that you can submit in each batch. The daily quota controls the total number that you can submit in a day. The per-minute rate limit controls the submission rate. The prefetch queue capacity controls the number of URLs that the queue can hold. If you exceed the per-submission limit, split the URLs into batches. If you exceed the rate limit, reduce the submission frequency. If you exhaust the daily quota, wait for it to reset or request a quota increase. Reducing the number of URLs in the current batch does not resolve an exhausted daily quota.

  2. The prefetch queue is full: Wait for existing tasks to run and free up queue capacity before you submit again. Do not keep retrying the same batch of URLs. Queue capacity is not the daily prefetch quota, and freeing up the queue does not restore the daily quota that has already been consumed. A batch script must continue only after you confirm that the previous batch completed or explicitly failed.

  3. Check the URL list for duplicates and split the URLs into batches based on hot-content priority. Files that are not hot usually do not need to be prefetched.

  4. If your business requires a higher quota, submit a quota increase request as prompted in the console. The following table describes the quotas:

    Method

    Quota limit

    URL purge

    Up to 10,000 URLs per account per day

    Directory purge

    Up to 100 directories per submission; up to 100 directories per domain name per minute

    Regular expression purge

    Up to 20 rules per account per day

    URL prefetch

    Up to 100 URLs per submission; up to 1,000 URLs per account per day

How do I resolve a permission denied or AccessDenied error when calling the purge or prefetch API?

  1. Make sure that the account to which the current credentials belong can manage the target accelerated domain name. Check whether the resource scope in the authorization policy includes the domain name.

  2. Calling the purge API requires the cdn:RefreshObjectCaches permission. Calling the prefetch API requires the cdn:PushObjectCache permission. If you call only one of these APIs, grant permissions for that operation. You do not need to grant permission to submit the other task type. If you use the console or query tasks or quotas, also grant query permissions such as cdn:DescribeRefreshTasks and cdn:DescribeRefreshQuota as required by the actual operations.

  3. If you use temporary credentials, make sure that the credentials have not expired and that the session policy does not further restrict these operations or the target resources.

An administrator with RAM authorization permissions must grant the missing permissions based on the principle of least privilege. For instructions and purge and prefetch policy examples, see Alibaba Cloud CDN custom policies.

Content is not updated after a purge

If you still see outdated content, response headers, or error responses after a task completes, distinguish among the origin status, CDN cached objects, and client caches.

How do I troubleshoot a completed purge task when requests still return outdated content or response headers?

  1. Check the origin: Bypass CDN and access the corresponding origin resource using the actual origin fetch Host, protocol, port, path, and query parameters. Verify that the origin returns the new content and response headers. If the origin still serves the old version, fix the origin first.

  2. Check the task URL: Check the protocol, hostname, path, query parameters, URL rewrite, and signing parameters to make sure that the task targets the actual cache key. If business query parameters contain /, encode it as %2F before submission. Leave path separators unchanged, and do not encode an already encoded percent sequence again.

  3. Check the subresources referenced by the page: HTML and the JS and CSS files that it references are separate cached objects. First verify that the origin HTML references the new files, and then purge the URLs of the subresources whose content was updated without changing their file names. For a long-term solution, use file names that contain a content hash instead of relying on same-name replacement.

  4. Check the purge type: For a single file, use a URL purge to delete the cache directly. Directory, regular expression, and parameter-ignoring purges might perform conditional origin fetches by default. If the origin returns 304 but the content has actually changed, use RefreshObjectCaches to set Force=true.

  5. Eliminate client caching: Access the URL again in private browsing mode or after you clear the browser cache. Purging the CDN cache does not clear the browser cache.

How do I resolve historical 404 or other error responses that CDN still returns after the origin file is restored?

  1. Bypass CDN and access the corresponding origin resource using the actual origin fetch Host, protocol, port, path, and query parameters. Verify that the origin now returns a normal response.

  2. Purge the specific file URL to delete the cached error response.

  3. Check the status code caching rules to make sure that the cache duration for error responses such as 404 is as expected. For general cache rule diagnostics, see Cache troubleshooting.

How do I troubleshoot a purge when only some regions or CDN nodes still return outdated content?

  1. Make sure that the purge task is complete, and compare the full URLs, DNS resolution results, Via, Age, X-Cache, and response content of normal and abnormal requests.

  2. Bypass CDN and access the corresponding origin resources using the actual origin fetch Host, protocol, port, path, and query parameters for normal and abnormal requests, respectively. Rule out different origins or protocols returning different versions.

  3. Make sure that different requests do not fall into different cached copies because of query parameters, cookies, request headers, or a custom cache key. If you still cannot locate the issue, provide the task ID, the time when the issue occurred, the client IP address, and the complete response headers for further troubleshooting.

A task is incomplete or prefetch results do not meet expectations

A completed prefetch task means only that the target resource was written to the origin fetch layer cache according to the task rules. It does not guarantee an immediate cache hit on every L1 node, and it does not mean that download speeds improve for all users.

How do I troubleshoot a purge or prefetch task that remains incomplete for a long time or shows a failed status?

  • Query the task status by task ID. Do not treat a successful response from the submission API as proof that the task is complete.

  • Check the queue capacity, the number of URLs, the origin response time, and the failed URLs. Split tasks involving large files or large numbers of URLs into batches.

  • If you submit tasks by using a batch script, verify the execution result of each batch by task ID. For instructions on how to use the script, see Use a script to purge and prefetch content.

How do I troubleshoot a completed prefetch task when the first request still shows MISS or has a slow response?

  • By default, prefetch writes resources to CDN origin fetch layer nodes and does not immediately cover all L1 edge nodes. The first request to a given L1 node can still show MISS.

  • Compare the protocol, hostname, path, and query parameters of the request URL and the prefetch URL to make sure that they map to the same cache key.

  • HIT proves only that the current request hit the cache, and MISS alone does not prove that the prefetch failed. Evaluate the task status, node layer, Age, Via, and the results of consecutive GET requests together.

How do I troubleshoot a failed prefetch task when the origin returns 30X?

This section applies when a prefetch task fails and the origin returns a 30X redirect when accessed using the actual origin fetch configuration. A 30X response from the service URL alone does not prove that the prefetch task failed.

Troubleshooting steps:

  1. Verify the origin redirect: Bypass CDN and send a GET request using the actual origin fetch Host, protocol, port, path, and query parameters. Record the status code and Location. Do not automatically follow redirects at first, because doing so might show only the final response and hide intermediate redirects.

    Check whether Location is an accessible specific file URL, and make sure that the final response is not a login page, an error page, or a directory address.

  2. Check redirect following: When the origin returns 301 or 302, CDN continues to access the Location address only if origin fetch 301/302 redirect following is enabled for the domain name. This feature does not apply to redirects such as 307 and 308. For these responses, first adjust the origin redirect rules or resubmit a URL under the accelerated domain name that directly serves the target file. Enabling redirect following does not guarantee a successful prefetch. Also check the redirect count limit, target reachability, and final response. For configuration instructions, see Configure 301/302 redirection.

  3. Check the prefetch object: Make sure that you submit a specific file URL. Prefetch does not support directory URLs.

  4. Check the URL format: The URL must include the full protocol prefix and must not contain full-width characters or extra spaces. Enter one URL on each line. Do not separate URLs with commas. Percent-encode non-ASCII characters using UTF-8, and do not encode an already encoded percent sequence again.

  5. Check URL rewrite: Nodes use the rewritten URL to generate the cache key. When you submit a task in the console, use the rewritten URL. When you submit a task through the API, also check the QueryHashkey parameter. When it is set to true, the API queries the actual cache key of the prefetch URL based on the domain configuration. For parameter details, see PushObjectCache.

  6. Check CDN URL signing parameters: When you submit a prefetch task, remove the CDN URL signing parameters but retain business query parameters. Do not delete the entire query string. Encode / in query parameters as %2F, and leave path separators unchanged. Successful task submission does not mean that the URL matches the target cache key. If the origin has separate authentication requirements, also check origin access permissions as described in How do I troubleshoot a prefetch URL that returns 403 or fails authentication?

How do I troubleshoot a prefetch URL that returns 403 or fails authentication?

Troubleshooting steps:

  1. Access the target URL directly to make sure that the origin allows CDN origin fetches. Check whether origin hotlink protection, IP restrictions, URL signing, or other access control rules reject the prefetch request.

  2. If the origin requires specific request headers or authentication information, submit the prefetch task through PushObjectCache by using the WithHeader parameter.

How do I handle download speeds that start fast and then slow down during prefetch, or increased origin load?

When multiple origin fetch layer nodes retrieve resources concurrently, the origin bandwidth, connection count, or disk capacity can become a bottleneck. Reduce the prefetch scope, submit tasks in batches, and prioritize hot large files.

For large files such as videos, consider using range origin fetch to retrieve segments only if the origin supports Range requests and correctly returns 206 partial responses. Range origin fetch increases origin fetch QPS and might trigger origin rate limiting. Prefetching an entire file might increase origin fetch traffic or origin load over a short period.