Purge CDN Cache

There are 3 approaches to purge the cache on KeyCDN. In all three cases is the scope of a purge bound to the context of a Pull Zone. Either clear the Pull Zone cache completely, which makes sense if you have a lot of changes, specify individual URLs that should be purged from the CDN cache, or purge by tag. Examples for an individual URL purge are an image that has been updated or a CSS file that has been modified.

Purge the CDN cache for the entire Zone

  • Login to the KeyCDN dashboard
  • Click on Zones from the left navigation bar
  • Click on the button Manage on the right side. Choose Purge from the drop down

Purge specific URLs (file)

  1. Login to the KeyCDN dashboard
  2. Click on Zones from the left navigation bar
  3. Click on the button Manage on the right side. Choose Purge URL from the drop down
  4. Enter one URL per line (e.g. demo-1.kxcdn.com/path/to/img.jpg) and click on the purge buttonCDN-Cache-URL-Purging

Purge by Tags

  1. Login to the KeyCDN dashboard
  2. Click on Zones in the left navigation bar
  3. Click on the blue Manage button for a particular zone and select Purge by Tag from the dropdown
  4. Enter a single or multiple tags separated by a space and click on the purge button CDN-purge-by-tags

The tags need to be generated via your origin server. To implement the Cache-Tag for an asset, simply add a Cache-Tag response header field to that asset. The Cache-Tag header field can have multiple tags, separated by a single space. The Cache-Tag header fields will not be removed by the KeyCDN edge servers, which allows you to check if you set them correctly.

Cache-Tag: tag1 tag2 tag3

Purge via API

It’s possible to purge via the API as well, the same way as it is available in the dashboard. The API documentation is available in the KeyCDN dashboard.

Note: Purging the CDN cache for the entire zone, a specific URL(s), or by tag(s) is done in a few seconds globally.

Push Zone Cache

The cache of a push zone cannot be purged. It requires approximately 15 minutes for newly uploaded / deleted files to be globally distributed. If you need more control over your assets in a push zone, it is recommended to use file name versioning(e.g. myfile-v13.txt) or path versioning (/v13/myfile.txt).