Purge
Purge one or more objects from the Akamai network using the Fast Purge API. Supports invalidation and deletion of URLs/ARLs, CP codes and cache tags, on both staging and production networks.
Usage
akcli purge [OPTIONS] [OBJECTS]...
Arguments
OBJECTSOne or more objects to purge (URLs/ARLs, CP codes or cache tags). Mutually exclusive with--from-file.
Options
--method [invalidate|delete]Purge method.invalidatemarks content as stale and lets Akamai re-fetch it on the next request.deleteremoves the object from cache entirely. Defaults toinvalidate.--purge-type [url|cpcode|tag]Type of objects to purge. Defaults tourl.--network [staging|production]Akamai network to purge from. Defaults tostaging.--from-file PATHPath to a plain text file with one object per line. Empty lines and leading/trailing whitespace are ignored. Mutually exclusive with positionalOBJECTS.--jsonOutput the result in JSON format, as returned by the Akamai API without parsing.
Note
Note that cache is disabled for this command — every invocation always reaches the API, since purge is a write operation and caching would silently skip the actual request.
Config file
The following options can be set in the [purge] section of the config file:
...
[purge]
method = "invalidate"
type = "url"
network = "staging"
Output
By default, a success message is shown with the purge ID and the estimated completion time:
Examples
Invalidate a URL on staging:
akcli purge https://example.com/image.jpg
Delete a URL from production:
akcli purge https://example.com/image.jpg --method delete --network production
Purge by CP code:
akcli purge 123456 --purge-type cpcode
Purge multiple cache tags at once:
akcli purge tag-1 tag-2 tag-3 --purge-type tag
Bulk purge from a file:
akcli purge --from-file urls.txt --purge-type url --network production