Skip to main content
POST
/
cdn
/
resources
/
{resource_id}
/
purge
Python
from gcore import Gcore

client = Gcore(
    api_key="My API Key",
)
client.cdn.resources.purge(
    resource_id=0,
)
This response does not have an example.

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

resource_id
integer
required

CDN resource ID.

Body

application/json
  • Purge by URL
  • Purge by pattern
  • Purge all cache
urls
string[]

Purge by URL clears the cache of a specific files. This purge type is recommended.

Specify file URLs including query strings. URLs should start with / without a domain name.

Purge by URL depends on the following CDN options:

  1. "vary response header" is used. If your origin serves variants of the same content depending on the Vary HTTP response header, purge by URL will delete only one version of the file.
  2. "slice" is used. If you update several files in the origin without clearing the CDN cache, purge by URL will delete only the first slice (with bytes=0… .)
  3. "ignoreQueryString" is used. Don’t specify parameters in the purge request.
  4. "query_params_blacklist" is used. Only files with the listed in the option parameters will be cached as different objects. Files with other parameters will be cached as one object. In this case, specify the listed parameters in the Purge request. Don't specify other parameters.
  5. "query_params_whitelist" is used. Files with listed in the option parameters will be cached as one object. Files with other parameters will be cached as different objects. In this case, specify other parameters (if any) besides the ones listed in the purge request.

Response

Successful.