Loading...


Related Products


Date Published: March 8, 2022

Platform CDN: Manually purging the CDN Cache

Manually purging all caches or individual objects from Platform CDN

Important Note: These instructions clear content from Platform CDN only. In order to replace it with fresh content, ensure that the content has also been purged from Acquia Varnish first.

First step: Retrieve the service_id and token

Run the following commands to SSH into your environment and use Drush to retrieve the service_id and token:

Your SSH URL can be found in your Acquia Environment Information Section in the Cloud UI.

Run the following command to retrieve your Platform CDN Credentials:

Drupal 7

drush8 @sitegroup.env vget acquia_service_credentials

Drupal 8/Drupal 9

drush9 @sitegroup.env ev 'print_r(\Drupal\Core\Site\Settings::get("acquia_service_credentials")["platform_cdn"]["configuration"]);'


The output will be similar to the following:

{
   {
      "service_id": "1MFG0lmpFvMCoiziPbKLBB",
      "token": "NFA6ZgZaQfC1u1117WJuu3cVbf0ChlDY"
   }
}

Second step: Purge Platform CDN 
Purge Platform CDN by running one of following curl commands with the token in the header and the service_id in the URL path as shown in the following example:

Purge whole domain

curl -X POST -H "Fastly-Key:<Platform CDN Token>" -H "Accept: application/json" https://api.fastly.com/service/<Platform CDN Service ID>/purge/[DOMAIN]

Purge by tag

curl -X POST -H "Fastly-Key:<Platform CDN Token>" -H "Accept: application/json" https://api.fastly.com/service/<Platform CDN Service ID>/purge/[TAG]

Purge everything

curl -X POST -H "Fastly-Key:<Platform CDN Token>" -H "Accept: application/json" https://api.fastly.com/service/<Platform CDN Service ID>/purge_all

For example:

curl -X POST -H "Fastly-Key:NFA6ZgZaQfC1u1117WJuu3cVbf0ChlDY" -H "Accept: application/json" https://api.fastly.com/service/1MFG0lmpFvMCoiziPbKLBB/purge_all

Before manually purging the Platform CDN cache, purge your Varnish cache to ensure cache consistency.
Further reading:
https://support-acquia.force.com/s/article/360004352373-Varnish-Bypassing-the-cache

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation