style
content

Setup push invalidation for Fastly

Push invalidation automatically purges content on the customer's production CDN (e.g. www.yourdomain.com), whenever an author publishes content changes or a developer pushes code changes to the main branch (changes on other branches do not trigger push invalidation).

Content is purged by url and by cache tag/key.

Push invalidation is enabled by setting up the Fastly purge credentials in the cdn section of the configuration service.

curl --request POST \
  --url https://admin.hlx.page/config/{org}/sites/{site}/cdn.json \
  --header 'content-type: application/json' \
  --data '{
	"prod": {
		"host": "{production host}",
		"type": "fastly",
		"serviceId": "{serviceId}",
		"authToken": "{authToken}"
	}
}'

Configuration properties:

key value comment
host <Production Host> Host name of production site, e.g. www.yourdomain.com
type fastly
serviceId <Fastly Service ID> Service ID of production service
authToken <Fastly API Token>

To create a Fastly API Token,

You can validate the credentials with this tool.