Alibaba Cloud Content Delivery Network (CDN) allows you to refresh and prefetch resources from origins. The refresh feature allows you to force CDN nodes to communicate with origins and obtain the latest files. The prefetch feature allows you to load frequently accessed resources to CDN nodes before peak hours to improve resource access efficiency. This topic describes how the refresh and prefetch features work, the time required by a refresh or prefetch task to take effect, and the related API operations.

The concepts of refresh and prefetch in Alibaba Cloud CDN are as follows:
  • Refresh: After a URL refresh or directory refresh request is submitted, the corresponding resource cached on the CDN node will forcibly expire. When the CDN node receives a request for the resource, it directly fetches the resource from the origin. The CDN node then caches the resource and returns it to the requestor. The refresh feature reduces the cache hit ratio.
  • Prefetch: After a URL prefetch request is submitted, the origin server automatically caches the corresponding resource to the CDN node. When the CDN node receives a request for this resource for the first time, it directly returns the resource from the cache without fetching the resource from the origin. The prefetch feature increases the cache hit ratio.
The following table describes the refresh and prefetch features.
Category How it works Time to take effect API operation
URL refresh CDN nodes are forced to retrieve the latest versions of the specified files from the origin. Within 5 minutes RefreshObjectCaches
Directory refresh CDN nodes are forced to retrieve the latest files in the specified directories from the origin. RefreshObjectCaches
URL prefetch Alibaba Cloud CDN requests the specified resources from the origin before it receives any requests for these resources and caches them to a CDN L2 node. When these resources are requested, the CDN L2 node returns them directly from the cache. PushObjectCache