Refresh CDN Cache

Last update:2024-06-24 17:57:46

Cache Refresh allows you to force the CDN servers to fetch the latest files from the origin server and cache them, overriding the existing cached files.

Cache Refresh is suitable for the following scenarios:

  • When the cached files on the CDN are outdated, and you want to immediately purge the new files from the origin server to the CDN servers, ensuring that end users no longer access the old resources.
  • When the cached files on the CDN violate policies, and you want to immediately remove the cached files from the CDN servers, ensuring that end users no longer access the non-compliant resources.

Cache Refresh supports multiple types: URL Refresh, Directory Refresh, RegEx Refresh and Domain Refresh.

How to Create a Cache Refresh Task

  1. Before creating a task, make sure you have purchased CDNetworks’ CDN product, configured the acceleration service for your domain, and contacted CDNetworks technical support to enable Cache Refresh permissions.
  2. Log in to CDNetworks Console, navigate to “Products” > “Application Services” > “Content MGMT” > “Cache Refresh”, and click on Create Task.
  3. Set up the cache refresh task according to your needs.

Image

Refresh Types

Refresh Type Description Notes
URL Refresh Refreshes the cache at the URL granularity, suitable for a small number of files. 1. The pushed URLs need to be case-sensitive;
2. URLs should start with a protocol such as http:// or mms://. For example: http://www.test.com/index.html;
3. One URL per line, multiple URLs separated by line breaks.
Directory Refresh Refreshes the cache at the directory granularity, recommended when the URLs that need updating under a directory exceed 100. 1. The pushed directories need to be case-sensitive;
2. Directories should start with a protocol such as http:// or mms://. For example: http://www.test.com/news/ ;
3. One directory per line, multiple directories separated by line breaks;
4. If you want to refresh all directories under a domain, enter the root directory of the domain, such as: http://www.test.com/;
5. If your domain has beed configured with cache host or any other rewriting configurations, please contact CDNetworks Technical Support to confirm how to submit refresh task, we will evaluate it based on your situation.
Regex Refresh Refreshes the cache using regular expression-based URLs. One URL per line, starting with a protocol such as http://, supporting protocols include http, https, mms. For example, to clear the js files under a certain directory, the submitted URL should be http://www.test.com/test/(.*).js(.*).
Domain Refresh Refreshes the cache at the domain granularity, strongly recommended to contact technical support for evaluation before proceeding. 1. You can directly enter the domain that needs to be refreshed without any protocol;
2. The system will refresh the cache files by default using the http:// and https:// protocols. If you need to refresh using other protocols, please use Directory Refresh or URL Refresh.

If your domain has beed configured with cache host or any other rewriting configurations, please contact CDNetworks Technical Support to confirm how to submit refresh task, we will evaluate it based on your situation.


After selecting the refresh type you want, input the configuration items and then submit your refresh task. below are the mainly configuration items.

please noted that different refresh types have different configuration items.

Common URL/Common Directory
Click + Common URL or + Common Directory to select and add commonly used URLs/Directories. Select the commonly used URLs/Directories and click Add to Push Box to automatically input them into the text box for initiating the refresh task. This function provides management of common URLs/Directories, allowing you to add or delete them.

Image Image

Task Types

  • Immediate: The task should be executed immediately after submission. If you do not want immediate execution, you can set a Delay Time to determine when the task will be executed.
  • Cycle: The task should be executed repeatedly, supporting the setting of recurrence time and frequency.

Image Image

All in Lowercase

  • Yes: Converts each letter in the URI part of the refresh content to lowercase.
  • No: Does not convert lowercase letters.

Image

How to View Cache Refresh Tasks

Log in to CDNetworks Console, navigate to “Products” > “Application Services” > “Content MGMT” > “Cache Refresh”, and click on Task Query. You can query cache refresh tasks based on a specific time, domain, or complete URL, and you will see the following information about the target task.

Image

Success Ratio
Success Rate = Number of successful executions / Total number of executions
A single refresh task needs to be sent to various CDNetworks CDN servers for execution, meaning the refresh task needs to be executed multiple times.

How to Manage Recurring Tasks of Cache Refresh

Recurring tasks refer to the tasks set up as recurring cache refresh tasks when creating a cache refresh task. After a task is successfully submitted, you can query and edit all recurring tasks under Timing Management.

  1. og in to CDNetworks Console, navigate to “Products” > “Application Services” > “Content MGMT” > “Cache Refresh”, and click on Timing Management to display all recurring tasks by default. You can also query based on search criteria.
  2. Find the recurring task you want to handle, click the Image button on the right to re-edit the recurring task, or click the Image button to delete the recurring task.

Image

Notes

When submitting a cache refresh task for the same URL/Directory/Domain within a short period, please make sure to wait for at least 5 minutes between submissions. For example, if the system has not completed the execution of the first URL task and a same URL task is received at that time, the latter task might be ignored by the system.

Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!