Skip to main content
Purge is an option that clears the CDN resource cache. Use it when content on the origin is updated and waiting for natural cache expiration is not acceptable, or when CDN servers are serving incorrect content. Three options are available for clearing the cache:
  1. Purge by URL (recommended) to remove content that belongs to a particular URL from the cache without impacting other cached items.
  2. Purge all to remove all data from the cache.
  3. Purge by pattern to remove content selectively by specifying path patterns with the * operator that can replace any number of symbols.
The cache can be cleared in the Gcore Customer Portal or via the CDN Purge API.

Configure purge in the Gcore Customer Portal

  1. In the Customer Portal, navigate to CDNPurgePurge request.
The Purge request page opens.
  1. Select the relevant CDN resource from the dropdown menu.
  2. Select the desired purge type by clicking the radio button next to it, then follow the instructions below.
  3. Click the Purge button.
Purge request page with CDN resource dropdown and purge type selection
Two purge requests per resource per minute are allowed. One purge request is limited to 100 URLs, so up to 200 files can be removed from the cache per minute.
In the text area, specify one or more content URLs to purge, entering one URL per line. Links must:
  • Start with a slash (/).
  • Not include a protocol, domain name, or wildcard (*).
  • Include query strings if the CDN resource cache is configured to consider the query string.
To purge https://www.example.com/pictures/icon.jpg?size=small, specify /pictures/icon.jpg?size=small.
Purge by URL section with text area for entering URLs
Click Show more under the text area to see additional recommendations.Avoid this method in the following cases:
  • A Vary HTTP response header is present on the origin. Purge by URL deletes only one version of the file.
  • Large file delivery optimization is enabled. When several files on the origin are updated without clearing the CDN cache, Purge by URL deletes only the first slice (with bytes=0…).
The behavior of Purge by URL also depends on the Ignore Query string option:
  • If the value is Ignore All, do not specify parameters in the Purge request.
  • If the value is Ignore All Except, only files with the parameters listed in the option are cached as different objects. Files with other parameters are cached as one object. In this case, specify the listed parameters in any order in the Purge request. Other parameters should not be specified.
  • If the value is Ignore Only, files with the parameters listed in the option are cached as one object. Files with other parameters are cached as different objects. In this case, specify other parameters (if any) besides the ones listed in any order in the Purge request.

Configure purge via API

The example below shows Purge by URL via API. Examples of other purge types (all and by pattern) are in the API documentation.
An API token is required for authenticated requests. The example below uses Postman. To send a purge by URL request:
  1. In Postman, open a new request tab, then do the following:
a. Set the request method to POST. b. Enter the resource URL in the request URL field. Replace {{resource_id}} with the actual value.
Postman request tab with POST method and resource URL
  1. Navigate to the Authorization tab and do the following:
a. Select Bearer Token from the Type dropdown. b. Copy the generated access token and paste it into the Token field.
Postman Authorization tab with Bearer Token type selected
  1. Navigate to the Body tab and do the following:
a. Select raw as the data type. b. Select JSON from the format dropdown. c. Enter the payload in the text area. Replace the sample values indicated by {{ }} with actual values.
Postman Body tab with raw JSON payload
  1. Click Send.
If the purge is successful, the API returns HTTP 201 and a response body containing a list of purged URLs.
Postman showing HTTP 201 response with list of purged URLs
If an error occurs, the API returns a status code and a response body describing the cause. Example:
Postman showing error response with status code and description

View purge history

Purge history is the section where the status of all purge requests can be checked.
Purge history stores requests for the past month only.
To view the history, navigate to the Purge history page. The page displays all existing requests. Use filters to display specific requests:
  • Search by CNAME. Specify the CNAME of the CDN resource.
  • Type. Select the purge type (Purge by URL, Purge all, or Purge by pattern).
  • Status. Select the status (In progress, Successful, Failed, or Status report disabled).
  • Date. Set the time period (up to one month).