Help Center > > User Guide> Cache Refreshing and Preheating

Cache Refreshing and Preheating

Updated at: Dec 14, 2019 GMT+08:00

Cached content on CDN nodes is not updated in real time. CDN nodes only retrieve new content from origin servers when cached content has expired. If you want users to obtain the latest content after the content on an origin server is updated, you can refresh the cache to forcibly expire the CDN cache. If the content needs to be updated, refresh the cache and pre-load the new content.

Background

The differences between refreshing and preheating the cache are as follows:

Cache refreshing: When a cache is refreshed, the cached content on CDN nodes will be forcibly expired. If a user requests content has been cached, CDN will have to retrieve fresh content from the origin server and then caches that new content.

Cache preheating: When a cache is preheated, the origin server proactively sends the most current content to the CDN nodes to be cached. If a user requests the content, the CDN node immediately returns the cached content. It does not need to retrieve any new content.

Prerequisites

This item can only be configured when the domain name status is Enabled or Configuring, and the domain name is not banned. For details about the domain name statuses, see Viewing Domain Name Information.

Cache Refreshing

Cache refreshing includes URL refreshing and directory refreshing. URL refreshing forces specific files to expire. Directory refreshing forces all of the files in a directory to expire.

When refreshing a cache, note that:
  • Each account can refresh a maximum of 2,000 URLs per day and a maximum of 1,000 URLs per task.
  • Each account can refresh a maximum of 100 directories per day at a time.
  • It takes about 5 minutes for a refreshing task to take effect.

To submit a cache refreshing task:

  1. Log in to the HUAWEI CLOUD console. On the homepage of the HUAWEI CLOUD console, choose Storage > CDN. The CDN console is displayed.
  2. On the left navigation menu, select Refreshing & Preheating.
  3. Click the Cache Refreshing tab, select the refreshing type, and enter the URLs or directories to be refreshed.

    Figure 1 Cache refreshing
    • URL: A URL must start with http or https. Separate the URLs with semicolons (;) or line breaks.

      Example:

      http://www.example.com/file01.html
      http://www.example.com/file02.html 
    • Directory: A URL must start with http or https and end with a slash (/). Separate the URLs with semicolons (;) or line breaks.
      Example:
      http://www.example01.com/folder01/
      http://www.example01.com/folder02/

      When you choose directory refreshing, all resources, including resources in subdirectories, in the directory are refreshed.

  4. Click Submit.

    After a refreshing task is submitted, you can view the status of the task on the Task Progress tab page.

Cache Preheating

Cache preheating means proactively sending content to CDN nodes so that users can obtain the most current content from the CDN nodes in a timely manner.

When preheating a cache, note that:
  • Each account can preheat a maximum of 1,000 URLs per day or pear task.
  • The time required to complete a preheating task depends on the number and size of files to be preheated, and on network conditions.
  • Preheating a large number of files may fully occupy the bandwidth resources of your origin server. You are advised to do the preheating in batches.
  • Dynamic files, such as .asp, .jsp, and .php files, cannot be preheated. Do not preheat dynamic files.

To submit a cache preheating task:

  1. Log in to the HUAWEI CLOUD console. On the homepage of the HUAWEI CLOUD console, choose Storage > CDN. The CDN console is displayed.
  2. On the left navigation menu, select Refreshing & Preheating.
  3. Click the Cache Preheating tab, select the preheating type, and enter the URLs to be preheated.

    Figure 2 Cache Preheating

    URL: A URL must start with http:// or https://. Separate the URLs with semicolons (;) or line breaks.

    Example:
    http://www.example.com/file01.html
    http://www.example.com/file02.html 

  4. Click Submit.

    After a preheating task is submitted, you can view the status of the task on the Task Progress tab page.

    If the cache preheating status of a URL is Completed, the preheating is complete.

View Task Progresses

After a cache refreshing or preheating task is submitted, you can view the task status on the Task Progress tab page.

  1. Log in to the HUAWEI CLOUD console. On the homepage of the HUAWEI CLOUD console, choose Storage > CDN. The CDN console is displayed.
  2. On the left navigation menu, select Refreshing & Preheating.
  3. Select the Task Progress tab to check the status of refreshing and preheating tasks.

    Figure 3 Viewing task progresses

Quotas for Refreshing and Preheating

Quotas are enforced for service resources on the platform to prevent unforeseen spikes in resource usage. Quotas can limit the number or amount of resources available to users. Table 1 describes the restrictions on the numbers of URLs and directories that an account can refresh each day, and the number of URLs that an account can preheat each day.

Table 1 Quotas for refreshing and preheating

Type

Description

Total Quota

Number of URLs refreshed per day

Maximum number of URLs that can be refreshed by an account each day

2000

Number of directories refreshed per day

Maximum number of directories that can be refreshed by an account each day

100

Number of URLs preheated per day

Maximum number of URLs that can be preheated by an account each day

1000

If the existing resource quota cannot meet your service requirements, you can submit a service ticket to request a higher quota.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel