All Products
Search
Document Center

Edge Security Acceleration:Refresh and prefetch resources

Last Updated:Sep 15, 2026

Purging instantly removes specified content from the DCDN cache, forcing a retrieval of the latest version from your origin server. This ensures immediate content updates, lets you apply configuration changes, and removes non-compliant materials without waiting for the cache to expire. Prefetching proactively loads your resources onto DCDN points of presence (POPs) before peak traffic hits. This protects your origin server from overload and guarantees a fast, cached response for the first wave of users during launches or high-demand events.

Function Introduction

Resource purge

A purge operation sends a cache invalidation command to DCDN POPs, rather than directly deleting files. When a POP receives the command, it marks the matching cached resources as invalid or expired. The next time a user requests the resource, the POP detects the invalid cache, retrieves the latest version from the origin server, and serves it to the user while caching the new version.

Scenarios

  1. Update and release content: After you update resources on your origin server, you can purge their URLs or directories. This ensures that users receive the latest versions instead of stale content.

  2. Remove non-compliant content: If you delete non-compliant content from your origin server, it might still be accessible from the DCDN cache. You can use the URL purge feature to clear the cache and ensure that the content is completely removed.

Resource prefetch

Prefetching prompts DCDN POPs to retrieve resources from your origin server based on a provided URL list and cache them. This process differs from the origin server actively pushing content. Prefetching improves the loading speed of new resources or promotional pages for first-time visitors and reduces back-to-origin traffic during high-traffic events, which protects your origin server.

Scenarios

  1. Onboard Alibaba Cloud DCDN: When you first start using Alibaba Cloud DCDN, you can prefetch your popular static resources to the POPs. This improves access speeds and enhances the user experience.

  2. Support promotional campaigns: Before you launch a major promotional campaign, you can prefetch all static resources for the campaign pages to the DCDN POPs. When the campaign begins, the POPs directly serve all user requests for these resources, which ensures fast page loads.

  3. Publish installation packages or large files: Before you release a new software version or update package, you can prefetch the resources to the DCDN POPs. After the official launch, the POPs directly handle user download requests, which accelerates download speeds and reduces the load on your origin server.

Scenarios

The following table describes common scenarios for refresh and prefetch.

Feature

Scenarios

Refresh

  • Resource updates and publishing

    After resources on the origin server are updated or upgraded, purge them by submitting their URLs or directories to allow users to bypass the stale cache and directly access the latest resources, which are then cached on the DCDN nodes.

  • Non-compliant resource removal

    If your origin server contains non-compliant content mentioned in Limits, the content may still be accessible from DCDN POPs even after you delete it from the origin server. Use URL refresh to update the cached resources.

Prefetch

  • Operational activities

    For a large-scale event, you can prefetch the static resources on the event page to DCDN nodes in advance. After the event starts, all static resources that users access are already cached on DCDN POPs and are served directly by these POPs.

  • Installation package releases

    Prefetch resources to the DCDN POPs before you publish a new version of an installation or update package. After the product is officially launched, download requests from many users are served directly by the DCDN POPs. This improves download speeds, significantly reduces the load on the origin server, and enhances the user experience.

Notes

  • Notes on cache purge:

    • Submitting many purge tasks clears a significant amount of cache. This causes a sudden increase in back-to-origin bandwidth and requests, which increases the load on your origin server. We recommend that you perform this operation during off-peak hours.

    • A purge task takes about 5 to 6 minutes to take effect. If the cache time-to-live (TTL) for a file or directory is less than 5 minutes, you do not need to perform a purge. You can wait for the cache to expire and update automatically.

    • URL purge, directory purge, and regex-based purge all support shared cache. If a domain name is configured with a shared cache, you can submit a purge task using the primary domain name or any associated domain name to clear the cache.

  • Notes on cache prefetch:

    • After a prefetch task is submitted and successfully executed, the DCDN nodes immediately retrieve the required resources from the origin server. Submitting many prefetch tasks at once generates many concurrent back-to-origin tasks, which causes a sudden increase in back-to-origin bandwidth and requests. We recommend that you perform this operation during off-peak hours.

    • By default, a prefetch request includes the Accept-Encoding:gzip header. To include other headers or enable multi-replica prefetching, call the Prefetch URLs OpenAPI operation and set the WithHeader request parameter.

    • During prefetching, if the origin server returns a redirection status code such as 307, the prefetch task does not follow the redirection and fails. However, if the origin server returns a 301 or 302 status code and you have enabled 301/302 redirects for origin fetch on DCDN, the prefetch task is not affected.

  • General notes:

    • If a domain name is configured with Rewrite Access URL, the node uses the rewritten URL to generate the CacheKey. You must submit the rewritten URL for refresh and prefetch operations.

    • To use a RAM user to refresh and prefetch resources, grant the required permissions to the RAM user first. For more information, see Grant permissions to a RAM user to refresh and prefetch resources.

    • You cannot abort a URL purge or cache prefetch task after it is submitted.

    • When you submit a cache purge or prefetch task, if the URI contains non-ASCII characters, such as spaces or Chinese characters, you must encode the URL. Otherwise, the task cannot be recognized.

Refresh resources

  1. Log on to the DCDN console.

  2. In the navigation pane on the left, choose Tools > Purge and Prefetch.

  3. On the Purge Cache tab, configure the refresh rules.

    Parameter

    Description

    Operation

    Select Purge.

    Operation Method

    You can refresh by URL, Directory, or Regular Expression.

    URL

    • By default, each Alibaba Cloud account can refresh up to 10,000 URLs and 100 directories (including subdirectories) per day. If the daily peak bandwidth of your account exceeds 200 Mbps, you can request a quota increase in Quota Management. Alibaba Cloud evaluates and configures the quota based on your actual business needs.

    • By default, an Alibaba Cloud account can submit up to 20 regex-based refresh tasks per day. If the peak bandwidth of your account exceeds 10 Gbps, you can submit a ticket to request a quota increase.

    • URL refresh

      • The URL must start with http:// or https://.

      • To refresh multiple URLs, enter one URL per line.

    • Directory refresh

      • The URL must start with http:// or https:// and end with a forward slash (/).

        • To refresh all files in the root directory: http://example.com/.

        • To refresh all files in the /path/test/ subdirectory: http://example.com/path/test/.

      • To refresh multiple URLs, enter one URL per line.

      • You can submit up to 100 directory refresh tasks at a time, and up to 100 per minute for a single domain name.

      • By default, directory refresh uses the "refresh changed resources" method. If a user request matches a resource in the directory, the DCDN node retrieves the Last-Modified information of the resource from the origin server. If the information is the same as that of the currently cached resource, the node directly returns the cached resource. If it is different, the node pulls the new resource from the origin server, returns it to the user, and caches the new resource.

    • Regex-based refresh

      For more information, see Regex-based refresh.

  4. Click Submit.

  5. View the refresh progress.

    After you submit a refresh task, you can view its details and progress on the Records tab. The task may take a long time if you refresh many resources.

Prefetch resources

  1. Log on to the DCDN console.

  2. In the navigation pane on the left, choose Tools > Purge and Prefetch.

  3. On the Purge Cache tab, configure the prefetch rules.

    Parameter

    Description

    Operation

    Select Prefetch.

    Operation Method

    Only URL prefetch is supported.

    URL

    • The URL must start with http:// or https://. The URL must be the exact path of a resource file. Directories ending with a forward slash (/) are not supported.

    • To prefetch multiple URLs, enter one URL per line.

    • URL prefetch quota (daily): An Alibaba Cloud account can submit up to 1,000 URL prefetch tasks per day, with a maximum of 100 per submission.

      If the daily peak bandwidth of your account exceeds 500 Mbps, you can request a quota increase in Quota Management. Alibaba Cloud evaluates and configures the quota based on your actual business needs.

    • Prefetch queue rule: The prefetch queue for each account can hold a maximum of 100,000 URLs. DCDN prefetches URLs in the order they are submitted. When the number of URLs to be prefetched in the queue reaches 100,000, DCDN rejects new prefetch tasks.

    • Prefetch speed: The prefetch speed depends on the average file size. Smaller files are prefetched faster.

  4. Click Submit.

  5. View the prefetch progress.

    After you submit a prefetch task, you can view its details and progress on the Records tab. The task may take a long time if you prefetch many resources.

Related API operations

You can also call API operations to refresh and prefetch resources.

API

Description

RefreshDcdnObjectCaches

Refreshes the content of specified URLs on cache nodes. Supports batch URL refresh.

Note

URL refresh, directory refresh, and regex-based refresh all support shared cache. If shared cache is configured for a domain name, you can submit a refresh task using the primary domain name or any associated domain name to purge the cache.

PreloadDcdnObjectCaches

Prefetches content from the origin server to L2 cache nodes. This ensures cache hits on first access and reduces the load on the origin server.

DescribeDcdnRefreshQuota

Queries the daily quotas and remaining quotas for URL refreshes, URL prefetches, and directory refreshes.

DescribeDcdnRefreshTasks

Queries whether a refresh or prefetch task has taken effect across the entire network.

DescribeDcdnUserQuota

Queries the resource quotas and usage for a user.

DescribeDcdnRefreshTaskById

Queries whether a refresh or prefetch task has taken effect across the entire network.