Purge and prefetch

Updated at: 2025-03-11 02:11

You can use the purge feature to delete resources that are cached on points of presence (POPs) and retrieve the most recent resources from the origin server. This feature is applicable to resource updates and releases on the origin server, illicit resource removal, and domain name configuration modifications. You can use the prefetch feature to cache frequently requested resources to POPs during off-peak hours. This feature reduces loads on origin servers and improves user experience. This topic describes how to use the purge and prefetch features.

Feature description

  • Purge: Mark the corresponding cached resources on all CDN POPs as invalid. When you request again, CDN will retrieve the resources from the origin server and return them to you, while re-caching the resources to the CDN POPs. The purge feature reduces the cache hit ratio.

  • Prefetch: The origin server actively caches the corresponding resources to CDN POPs. When you request the resources for the first time, you can obtain the latest resources from the CDN POPs without retrieving them from the origin server. The prefetch feature increases the cache hit ratio.

Scenarios

Feature

Scenario

Feature

Scenario

Purge

  • Update and release resources

    After resources on your origin server are updated, you can submit the URLs or the directories of the updated resources. Then, Alibaba Cloud CDN purges the resources that are cached on POPs. This ensures that visitors can retrieve up-to-date resources from POPs.

  • Remove illicit content

    After you remove illicit content from your origin server, visitors can still access the resources because the resources are cached on POPs. In this case, you need to use the purge feature to update the cache and remove the resources from POPs.

Prefetch

  • First-time access to Alibaba Cloud CDN

    After you first access CDN, you can choose to prefetch your hot static resources in advance. When users access the resources, they receive a direct response from the CDN POPs. This improves user access speed and reduces first access time.

  • Large-scale event

    When operating a large-scale event, prefetch the static resources involved in the event page to the CDN POPs in advance. After the event starts, all static resources accessed by users are already cached to the CDN acceleration POPs and directly responded by the acceleration POPs.

  • Installation Packages Or Other Large File Releases

    Before releasing a new version of an installation package or upgrade package, prefetch the resources to the CDN acceleration POPs in advance. After the product is officially published, the massive download requests from users will be directly responded to by the CDN acceleration POPs, improving download speed, significantly reducing origin server pressure, and enhancing user experience.

Procedure

  1. Log on to the ApsaraVideo VOD console.

  2. In the left-side navigation pane, choose Configuration Management > CDN Configuration> Refresh and Prefetch.

  3. On the Purge Cache tab, configure the purge or prefetch operation based on your business requirements.

    003

    The following table describes the parameters.

    Parameter

    Description

    Parameter

    Description

    Operation

    Supported operations:

    • Purge

      After resources are updated on the origin server, the URLs of the resources are purged. Then, the system clears the resources that are cached on POPs. When you access the purged URLs, the latest resources from the origin server are retrieved. The retrieved resources are also cached on POPs.

    • Prefetch

      You can prefetch frequently requested resources or less frequently visited resources during off-peak hours to improve the cache hit ratio.

    Object

    The type of the object that you want to purge or prefetch. Supported options:

    • List of methods

      This option is available only when you set Operation to Purge.

    • URL

      This option is available when you set Operation to Purge or Prefetch.

    URL

    If you need to purge or prefetch multiple URLs, enter one URL in each line. By default, the following limits apply to each Alibaba Cloud account. To increase the limits, contact your account manager or submit a ticket.

    • Purge resources based on directories

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

      You can purge up to 100 directories within each Alibaba Cloud account per day. You can submit up to 100 directories at a time.

    • Purge resources based on URLs

      Each URL must start with http:// or https://.

      You can purge up to 2,000 URLs within each Alibaba Cloud account per day. You can submit up to 1,000 URLs at a time.

    • URL prefetch

      Each URL must start with http:// or https://.

      You can prefetch up to 500 URLs within each Alibaba Cloud account per day. You can submit up to 100 URLs at a time.

  4. Click Submit.

  5. Click the Records tab.

    You can view the details of purge and prefetch records, including the object, type, time, status, and progress of each operation.

API operations

FAQ

  • On this page (1, T)
  • Feature description
  • Scenarios
  • Procedure
  • API operations
  • FAQ
Feedback
phone Contact Us