Create a Fastly API Token
- go to Personal API Tokens,
- click on “Create Token”,
- enter a name (e.g.
"Production Site Purge Token"
), - select “A specific service” and your production service from the drop-down list,
- check the “Purge select content (purge_select) — Purge by URL or surrogate key” check box,
- select “Never expire”,
- click on “Create Token”,
- copy the generated token value shown in the pop-up window.
Push invalidation uses the Akamai Fast Purge API, specifically Delete by URL and Delete by cache tag.
The Fast Purge API credentials consist of
host = akaa-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.luna.akamaiapis.net
client_token = akab-XXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXX
client_secret = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
access_token = akab-XXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXX
They can be generated by following the instructions at Create an API client with custom permissions.
Identity & Access Management
Create API client
Required group/role permissions:
You can validate the credentials with this tool.
Cloudflare
Configuration properties
Create an API Token
- go to API Tokens
- click on “Create Token”,
- go to “Create Custom Token” at the bottom and click on “Get started”
- enter a token name (e.g.
"Production Site Purge Token"
), - Permissions: “Zone”, “Cache Purge”, “Purge”
- Zone Resources: “Include”, “Specific zone”, “<your production zone>”
- click on “Continue to summary”
- click on “Create Token”,
- copy the generated token value.
Note that only sites on the enterprise plan will be surgically purged by url and cache key. A Purge All will be performed instead on non-enterprise sites every time an author publishes a content change.
You can validate the credentials with this tool.
CloudFront
NB: CloudFront does NOT support purging by cache tag/key. Purge by cache tag/key always triggers a purge all.
Configuration properties
Create the AWS credentials
In the AWS Console, open the IAM dashboard:
Select Users -> Add users:
Enter a user name and check “Access key - Programmatic access”:
On the “Set permissions” pane, click on “Create group”:
Enter a group name and select the CloudFrontFullAccess policy:
Create the user:
Finally, copy the Access key ID and Secret access key values:
You can validate the credentials with this tool.
Opt-In Request Header
The production CDN needs to send the following opt-in header to the origin in order to enable long cache TTLs:
X-Push-Invalidation: enabled