File Purging

Last update:2023-10-25 16:20:54

1 Feature Intro

1.1 Brief Introduction

Caching static files on the CDN edge PoPs is an important means of speeding up the website and streaming media. The website or streaming media administrators normally update content (such as content adding, deletion and modification) in the day-to-day operation. In order to help the website and video platform to better manage their cached content such as videos, images and software, CDNetworks provides the file purging feature to ensure that visitors have the access to the latest content even when stipulated caching has not expired. File purging are inclusive of URL purging, directory purging, cache-tag purging and RegEx purging.

1.2 Applicable Product Lines

  • Content Acceleration
  • Dynamic Web Acceleration
  • Media Acceleration

2 Feature Detail

2.1 Feature Description

  1. URL Purging
    Purge resources by the specified URL, for example, purge the URL of a picture: http://www.example.com/XXX.jpg
  2. Directory Purging
    Purge the URLs piece by piece can be time-consuming when there are many static website URLs need to be updated. The file purging feature enables the content update by directory based on the storage structure of website resource. If the directory structure URL has been enabled with directory purging, then all the files under the directory will be updated when the directory purging operation is conducted. For example, the content under “news” directory would be updated when the following directory, http://www.cdnetworks.com/news/, is purged.
  3. Cache-Tag Purging
    Origin servers apply tags to the content. When CDNs request files from origin servers, the latter will respond CDNs with content that has a “Cache-Tag” HTTP header and a specified tag value. CDNs sort out all the content by tag values, so customers can purge content by specified tags.
  4. RegEx Purging
    RegEx purging allows you to use regular expressions to target specific URLs or content for removal from the cache, giving you precise control over what gets cleared without affecting other content.The URLS input Start with “protocol name://”, and the supported protocols are http, https and mms. If you want to clear the js files under a certain directory, you need to submit an URL of http://www.aaa.com/test/(.).js(.)

China Premium Service控制台自助配置功能上线

2.2 Application Scenarios

If customers are highly time-sensitive or their day-to-day file updates amount is large, it is recommended for them to enable the purging service. Customers could select the most suitable purging mode based on their business types.

2.3 Fundamentals

After the file purging task is successfully submitted in the CDNetworks file purging system, the corresponding command is broadcast to all the edge PoPs used by the accelerated domain. The edge PoPs check the target file submitted by the customer, and mark the corresponding file as expired or directly delete the file.
URL/directory/cache tag purging can be divided into two modes: expire (first determine if the URL under the directory has expired) and delete (directly delete URL under the directory).

1) Expire

After the file is marked as expired, CDN edge PoPs will check by file name to see if the file attribute values of Last-Modified or Etag on the website origin server and on the CDN edge PoP are matched when receiving requests from end users. Take Last-Modified checking as an example. If the Last-Modified time of the file on the CDN edge PoP is earlier than that of the file on the origin, CDN server will determine that the cached file has expired. And CDN PoPs will download the newer file from origin server to replace the old version at the edge.
Similarly, if the Etag value of the file on CDN edge PoP is different from that on the origin server, then the server determines that the cached has expired. If the target file does not have the Last-modified or Etag attribute value, the server will retrieve a new file from the origin instead of doing the comparison. If the target file has both Last-Modified and Etag attribute values, the file is treated as expired when one of the attribute values is determined expired.

2) Delete

After CDN PoP receives the file purging command, it will not compare the cached file with the file on the origin, but directly delete it. As for the directory deletion, the system does not check with origin to see if the file has expired, but delete all the files under the directory. After the files are deleted, CDN PoPs will download the new files from origin.

2.4 Instructions

CDNetworks file purging system currently provides 2 operating channels: purge via Webpage and purge via API Interface.

  1. Purge via Web-page
    With the account and password of the CDNetworks customer service system, customer can log in and operate through the path of CDNetworks SI–[Service]— [Content management].
    Note: Purge via Web-page is currently not supportive for tag purging.
  2. Purge via API
    CDNetworks content purging interface is a set of APIs provided as an auxiliary for CDNetworks customer service platform. Through this interface, customers can delete or update their domain’s files in a self-service manner, so the website content will be updated timely, conveniently and flexibly. Please refer to the link below for CDNetworks API Interface Usage Instruction.
    • URL/directory purging: https://si.cdnetworks.com/v2/index/#/apidoc/apiDetail?docId=889&classify=ContentManagement
    • Cache tag purging: https://si.cdnetworks.com/v2/index/#/apidoc/apiDetail?docId=614&classify=ContentManagement

2.5 Notices

  1. Single file update: update 20,000 files per day by default.
  2. Email application is required if the purging files are more than 20,000 in a day.
    3 Key Benefits
  3. This feature effectively ensures customer’s timely access to the latest file.
  4. Improve user experience, and increase conversion rate.
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!