Support

Find answers, guides, and tutorials to supercharge your content delivery.

Purge CDN Cache

Updated on February 11, 2020

There are three approaches to purge the cache on KeyCDN. A Pull Zone cache can be cleared in all three ways, whereas a Push Zone cache can only be cleared in one way. A Pull Zone can either be completely cleared, which makes sense if you have a lot of changes, by URL, or by tag. Purging the CDN cache by URL or tag makes sense for specific changes, like if a single asset has been updated. A Push Zone can only be cleared by URL.

Note: Purging the CDN cache is done in a few seconds globally.

Purge the CDN cache for the entire Zone

  1. Log in to the KeyCDN dashboard.
  2. In the left navigation sidebar click Zones.
  3. In the Zones table click the Zone menu that you want to purge. From the drop down click Purge.

Purge by URL(s)

  1. Log in to the KeyCDN dashboard.
  2. In the left navigation sidebar click Zones.
  3. In the Zones table click the Zone menu that you want to purge. From the drop down click Purge URL.
  4. Enter one URL path per line (e.g. /path/to/example.css).
  5. Click Purge.

Purge by Tag(s)

  1. Log in to the KeyCDN dashboard.
  2. In the left navigation sidebar click Zones.
  3. In the Zones table click the Zone menu that you want to purge. From the drop down click Purge by Tag.
  4. Enter one or more tags separated by a space (e.g. tag1 tag2 tag3).
  5. Click Purge.

Tags need to be set on the origin server. For implementation simply add the Cache-Tag response header with the value being the tag you want set. Multiple tags can be set by separating each tag with single space, for example:

Cache-Tag: tag1 tag2 tag3

The Cache-Tag header will not be removed or modified by KeyCDN, which allows you to check if you set them correctly on the origin server.

Purge by API

It’s possible to purge through the API as well, the same way as it is available in the dashboard. Tags are combined using OR, which means any asset with any of the tags set in a request will be purged.

KeyCDN uses cookies to make its website easier to use. Learn more about cookies.