Alibaba Cloud Content Delivery Network (CDN) allows you to refresh and prefetch resources. You can use the refresh feature to force the CDN nodes that cache the target resources to retrieve the latest resources from the origin server. You can use the prefetch feature to fetch frequently requested resources before peak hours. This accelerates content delivery. This topic describes how to configure the refresh and prefetch features and how to query the operation logs that are generated.

Background information

The refresh and prefetch features include URL refresh, directory refresh, and URL prefetch. For more information, see Overview.

Procedure

  1. Log on to the Alibaba Cloud CDN console.
  2. In the left-side navigation pane, select Refresh and Prefetch.
  3. On the Refresh and Prefetch page, click the Refresh Cache tab and configure the refresh or prefetch feature as needed.
    Parameter Description
    Operation The type of the operation that you want to perform. Valid values:
    • Refresh

      After resources are updated on the origin server, you can refresh the URLs of the resources. The system clears the data of the resources that are cached on the CDN nodes. When clients visit the refreshed URLs, the corresponding CDN nodes redirect the requests to the origin server. This allows CDN to return the latest resources from the origin server to the clients and to cache a new version of the resources on the CDN nodes.

    • Prefetch

      At off-peak hours, you can prefetch frequently requested resources or CDN domains with low network traffic to increase the cache hit ratio.

    Object The type of the object that you want to refresh or prefetch. Valid values:
    • Directory

      After you set Operation to Refresh, this option is available.

    • URL

      After you set Operation to Refresh or Prefetch, this option is available.

    URL If you want to refresh or prefetch multiple URLs, enter one URL per line. When you enter the URLs, follow these rules:
    • Directory refresh

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

      Each Alibaba Cloud account can refresh up to 100 directories every day. You can refresh all these directories in a single operation.

    • URL refresh

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

      Each Alibaba Cloud account can refresh up to 2,000 URLs every day. You can refresh up to 1,000 URLs in a single operation.

    • URL prefetch

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

      Each Alibaba Cloud account can prefetch up to 500 URLs every day. You can prefetch up to 100 URLs in a single operation.

    Refresh and prefetch
  4. Click Submit.
  5. Click the Records tab.
  6. On the Records tab, specify the time range and operation type, enter a domain name or URL, and then click Search.

    You can check the refresh and prefetch records, including the target object, operation type, operation time, status, and progress for each operation.

API operations

You can call API operations listed in the following table to refresh and prefetch resources.
Operation Description
PushObjectCache Preloads the content on the specified origin sites to the L2 cache nodes.
DescribeRefreshQuota Queries the maximum number of URLs and directories that can be refreshed and preloaded daily, and the remaining number of URLs and directories.
DescribeRefreshTasks Queries the status of refresh and preload tasks.
RefreshObjectCaches You can call this operation to refresh the file content on the CDN nodes. Alibaba Cloud CDN supports refreshing content of multiple URLs at a time.