Purge Environment Cache
POST
/v1/environments/{id}/purge_cachePurge an environment's HTTP and CloudFlare cache by prefix, host, cache tag or file path.
It is important to note that Servebolt CDN users can only purge by Tags, or by Host. For full access to all types of purging, the website must be setup on the Accelerated Domains CDN.
Use only the correct CDN
Servebolt CDN and Accelerated Domains use different Zones inside Cloudflare, sending requests to the wrong zone will fail. Make sure to set the Type to be 'serveboltcdn' when on Servebolt CDN.
Add uniquness to your cache tags
To confirm uniqueness of the cache tags, make sure to use a prefix when adding them to HTTP headers on reponses, and again when requesting a purge. In the example the Environment ID has been used as a prefix. On Servebolt hosted services, the enviroment.json file can be found in the ~/ home of the SSH/FTP user on the server. In this file there is both the API bearer key and the Environment ID.
Request
the Environement id can be found in the ~/environment.json file under the key id
The API token can be found in the ~/environement.json file on servebolt hosting
Use "serveboltcdn" to define that you are on Servebolt CDN and not Accelerated Domains
{
"files": [
"https://example.com/image.jpg",
"https://example.com/article/about-caching",
"https://example.com/"
],
"prefixes": [
"https://example.com/static/files/",
"https://example.com/product/release/micro-site/"
],
"hosts": [
"staging.example.com",
"acceptance.example.com"
],
"tags": [
"1234-home",
"1234-post-archive",
"1234-term-caching",
"1234-term-performance"
]
}
Request samples
Responses
{}