Updated on 2024-02-18 GMT+08:00

FAQ

What Are the Differences Between Cache Purge and Prefetch?

The differences between cache purge and prefetch are:

  • Cache purge

    After you submit a cache purge request, cached content on CDN PoPs will be forcibly expired. If a user requests that content, CDN will have to request fresh content from the origin server and then cache that new content.

  • Cache prefetch

    After you submit a cache prefetch request, the origin server proactively sends the most current content to a CDN PoP to be cached. If a user requests the content, the CDN PoP immediately returns the cached content. It does not need to pull any new content.

For details, see Cache Purge and Prefetch.

Is There a Sequence Between CDN Cache Purge and Prefetch?

If you want to update cached content on CDN PoPs after your origin content is updated, pay attention to the following:

  • You must purge the cache first. It takes about 5 minutes for a cache purge task to take effect. Then, prefetch the cache.
  • If you skip cache purge and directly perform cache prefetch, the cached content on CDN PoPs will not be updated.
  • If you access CDN for the first time and no content is cached on CDN PoPs, you can directly perform cache prefetch to cache content to CDN PoPs.

Does Cache Purge Refresh Content Cached on All PoPs?

Yes.

Why Is a Particular Prefetch Task in the Being Processed Status for Such a Long Time?

Possible causes include:

  • The task was submitted during a peak hour, so it is still in the queue.
  • You are prefetching a large number of files. Prefetch will pull content from the origin server, so pulling a large number of files may consume all of the bandwidth available for your origin server. You are advised to:
    • Divide files to be prefetched into batches.
    • Prefetch files during off-peak hours, for example, at night.
    • Increase your origin server bandwidth.
  • The task has been completed but the status is not refreshed on the console. Refresh the console page and check again.

How Do I Purge the CDN Cache Where the Domain Name Includes a Wildcard?

When purging the cache for a domain name that includes a wildcard, enter the URLs or directories of the level-2 domain names to be refreshed. Do not enter a URL containing a wildcard, such as https://*.example.com/file01.html or https://*.example.com/file02/.

Example:

  • An acceleration domain name is *.example.com.
  • The level-2 domain name housing the content to be refreshed is abc.example.com.
    1. Enter the URL to be refreshed: https://abc.example.com/file01.html.
    2. Enter the directory to be refreshed: https://abc.example.com/file02/.

Why Is It That Even After I Prefetched or Purged the Cache, the Content Has Not Updated?

The interval between cache purge and prefetch may be too short. As a result, the purge fails. If a cache has just been purged or prefetched, it is recommended that you wait at least 5 minutes before repeating this action.

What Do I Do If a Cache Prefetch Operation Fails?

It is possible that:

  • A large number of files are being prefetched at the same time, and this operation has occupied all of the origin server's bandwidth. In this case, you are advised to perform prefetch operations in batches. You can also increase the bandwidth of the origin server to improve the efficiency.
  • The cache TTL of your requested content is 0. In this case, change the cache TTL.
  • Cache-Control is private, no-cache, or no-store. If Cache-Control is not configured, the default value private is used.
  • You requested to prefetch directories, dynamic content, or URLs whose cache TTL is set to 0.

Does CDN Support Directory Prefetch?

No. Only complete URLs can be prefetched. Prefetching directories is not supported. For details, see Cache Purge and Prefetch.

Do I Need to Prefetch or Purge HTTP and HTTPS URLs Separately?

No. You only need to prefetch or purge either HTTP or HTTPS URLs.

If CDN Is Enabled in and Outside the Chinese Mainland, Does It Need to Be Differentiated When Prefetch and Purge?

No. You can directly prefetch or purge the corresponding URLs.

Can I Prefetch M3U8 Files?

Yes.

Why Does the System Report an Error Indicating that I Have No Permission to Purge the Cache?

It is possible that your acceleration domain name has been disabled. Enable CDN for the domain name again. If your account is in arrears, CDN may have been disabled for your acceleration domain name.

Can the Cache Be Automatically Updated After a Static File on the Origin Server Is Updated?

No. However, you can call APIs to force the current content to expire and then prefetch new content. For details, see API Overview.

Are Cache Purge and Prefetch Mandatory?

It depends.

  • If a file is updated on an origin server, the file needs to be updated on CDN PoPs as well.
  • It is recommended that large files, especially video files, be prefetched to improve user experience.
  • Prefetch is not recommended for small files.

Currently, CDN does not support automatic purge or prefetch. You need to manually perform these operations.