Purging
A purge removes one file or a whole zone from every location. It is queued by one call, applied within about five seconds, and a second call reports how far it has got.
Purge a file, or the zone#
https://api.cachegenie.com/v1/cdn/{ZONE_ID}/purgePURGE_URLStringoptionalthe full http or https URL of one file on one of the zone's hostnames, up to 2,048 characters. Leave it out, send it asnull, send no body, or send a body that is not JSON, and the whole zone is purged.
curl -X POST https://api.cachegenie.com/v1/cdn/AB12CD34E/purge \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"PURGE_URL": "https://cdn.example.com/videos/intro.mp4"}'{
"CODE": 200,
"MESSAGE": "Purge request has been created for this CDN Zone URL/File.",
"DATA": {
"PURGE_ID": 9182
}
}A whole-zone purge answers Purge request has been created for this CDN Zone. with a PURGE_ID of its own. A URL that is not on one of the zone's hostnames is 400 PURGE_URL must be a full http(s) URL on one of this CDN Zone's hostnames.; a write that did not go through is 500 Unable to Purge CDN Zone - Internal Server Error, please try again.
What a file purge matches#
The exact path and query string, across every hostname of the zone, every encoding and every piece of a large file. /intro.mp4 and /intro.mp4?v=1 are two files; there is no wildcard or prefix form, so a folder is purged by purging the zone. The scheme and port in the URL are ignored. See Purging for what happens next.
Check a purge#
https://api.cachegenie.com/v1/cdn/{ZONE_ID}/purge/{PURGE_ID}{
"CODE": 200,
"MESSAGE": "Purge Status Returned.",
"DATA": {
"PURGE_ID": 9182,
"APPLIED_NODES": 2,
"ONLINE_NODES": 2,
"COMPLETE": 1
}
}APPLIED_NODESIntegerhow many of the servers counted inONLINE_NODEShave applied this purge.ONLINE_NODESIntegerhow many servers the purge is counted against: every server in service that has reported in the last 15 seconds, and any server that applied it and has gone offline since. A server that is offline and has not applied it applies it as soon as it is back, and is not counted.COMPLETEInteger1 once every server counted has applied it. Poll every few seconds until it is 1 before relying on the purge. While no server is counted it stays 0: the purge is queued and has not reached the network yet.
A purge id that does not belong to this zone answers 404 Purge not found for this CDN Zone.