There are several methods available for purging your Fastly CDN cache.
You may utilize the Fastly Command Line Interface (CLI) to purge your service by clearing all or specific objects. For further details, please refer to the following link: https://www.fastly.com/documentation/reference/cli/purge/
Furthermore, certain Content Management Systems (CMS) and frameworks are equipped with Content Delivery Network (CDN) integrations that automatically clear your objects following content modifications.
If you require your Fastly credentials, they can be located within your production or staging environments as environment variables or in the `fastly_tokens.txt` file of your Dedicated Generation 2 environments.
upsun ssh -p <PROJECT_ID> -e <ENVIRONMENT> "env | grep -i fastly"upsun ssh -p <PROJECT_ID> -e <ENVIRONMENT> "cat /mnt/shared/fastly_tokens.txt"
You can also SSH into your service and run the following command if your Fastly variables match our defaults;
curl -i -X POST "https://api.fastly.com/service/$FASTLY_API_SERVICE/purge_all" -H "Fastly-Key: ${FASTLY_API_TOKEN}" -H "Accept: application/json"
Comments
In https://support.platform.sh/hc/en-us/articles/33475578229906-How-to-manage-your-own-Fastly-configuration-custom-VCL, the variable name is FASTLY_API_SERVICE, but in this page it's FASTLY_SERVICE_ID.
Hi Solihin,
You are correct, the variable is
FASTLY_API_SERVICE, notFASTLY_SERVICE_ID.Thank you for spotting this error, we will update this article with the correct variable name
Please sign in to leave a comment.