Information for: DEVELOPERS   PARTNERS

Acquia Cloud Platform CDN

This documentation page describes features and procedures for a beta product, and its contents may change at any time. Acquia does not recommend bookmarking this page as its location may change without notice.
This feature is available only for eligible Acquia Cloud Enterprise subscribers. For more information, contact your Account Manager.

Using the Acquia Cloud Platform CDN, you can deliver accelerated digital experiences to global audiences by caching pages and static assets (including JavaScript, CSS, and images) at over 65 points of presence (POPs) around the world. Visitors accessing your website will load the static assets from the POP closest to their location, which decreases the amount of time required to load a page, and can lead to increased conversions.

Acquia configures and manages the Acquia Cloud Platform CDN so you don’t have to. Based on years of experience accelerating Drupal applications through Varnish®, Acquia has configured the Acquia Cloud Platform CDN to optimize the delivery of digital experiences built with Drupal.

Setting up Acquia Cloud Platform CDN

To enable the Acquia Cloud Platform CDN for your subscription, complete the following steps:

  1. Contact your Account Manager to start the activation process. Provide information about the following resources for which you want to enable access:

    • Applications
    • Environments
    • Domain names

    Note

    You must deregister the domain with Fastly before Acquia can configure the domain to work with the Acquia Cloud Platform CDN.

  2. After activation, Acquia provides both the Acquia Cloud Platform CDN IP address and hostname, and added code for use with the Drupal 8+ version of the Acquia Purge module.

  3. Complete the following steps depending on whether you’re using Drupal 7 or any version since Drupal 8.

    1. Install and enable the Acquia Purge module. Be sure to incorporate the provided, updated Acquia Purge module code into your website’s codebase.
    2. Sign in to your Drupal website as an administrator, and then enable the acquia_cdn_purge module.
    3. Navigate to Configuration > Development > Performance > Purge to review the Purge module status. To the right, Status displays Platform CDN which should be green. If it displays red, contact Acquia Support.

    Install and enable the Acquia Purge module, but only enable the Acquia Cloud purger. The Acquia Purge module will keep the Drupal and Varnish caches in sync. For more information, see the Acquia Knowlege Base article Acquia Purge FAQ for Drupal 7.

  4. Configure your authoritative DNS to route traffic to your domains through the provided IP address and hostname by using one of the following methods:

    • Apex (root) domains: Add an A record that points your apex domain (root domain) to the Acquia Cloud Platform CDN IP address.
    • Subdomains: Add a CNAME record that points your domain name to the assigned Acquia Cloud Platform CDN hostname.

SSL certificates and Acquia Cloud Platform CDN

Acquia Cloud Enterprise supports SSL certificates on both the Acquia Cloud Platform CDN and on Acquia Cloud balancers, enabling you to deliver fully secure experiences for your visitors. If you want to deploy your SSL certificate on Acquia Cloud Platform CDN, contact Acquia Support for assistance.

Note

Ensure your certificates use a 2048-bit private key before enabling the Acquia Cloud Platform CDN. Only certificates created with a 2048-bit private key can be used with Acquia’s Platform CDN.

Maintaining cache consistency

The Acquia Cloud Platform CDN fully respects both HTTP Cache-Control headers and tag-based invalidation, which was first introduced in Drupal 8. Acquia recommends continuing to use both methods as part of your application’s caching strategy.

Configure the Drupal 7 cache-control headers

As Drupal 7 doesn’t support tag-based invalidation by default, Acquia recommends setting Drupal’s maximum time for keeping cached assets to 60 minutes. This allows assets to remain efficiently cached for a moderate amount of time before updates are fetched from Drupal. This value can be configured downwards as needed to ensure your visitors receive up-to-date content.

To configure the maximum time, from your website’s administrative menu:

  1. Go to Configuration > Development > Performance.

  2. Enable caching for anonymous users and set Expiration of cached pages to the duration you require.

    Caching and performance settings

The settings displayed in the image will generate the following HTTP headers:

Cache-Control: public, max-age=3600

Public means the response may be stored by all caches, including Varnish, the Platform CDN, and browser caches.

Purging the Platform CDN cache

You can manually purge the Platform CDN cache using the curl command. To do this complete the following steps:

  1. Run the following grep command to locate the API ID and secret in the settings.inc file:

    grep -A 10 acquia_service_credentials /var/www/site-php/sitename/*settings.inc
    

    The output will appear similar to the following:

    D8-sitename-common-settings.inc:$settings['acquia_service_credentials'] = array (
    D8-sitename-common-settings.inc-  'platform_cdn' =>
    D8-sitename-common-settings.inc-  array (
    D8-sitename-common-settings.inc-    'vendor' => 'fastly',
    D8-sitename-common-settings.inc-    'configuration' =>
    D8-sitename-common-settings.inc-    array (
    D8-sitename-common-settings.inc-      'service_id' => '4SsvFsxK25Z7t16kTqzu7d',
    D8-sitename-common-settings.inc-      'token' => 'DMDf1ryoZiERdryIxQAb4seLOBqLfLMU',
    D8-sitename-common-settings.inc-    ),
    D8-sitename-common-settings.inc-  ),
    D8-sitename-common-settings.inc-);
    
  2. Purge the Platform CDN by running the following curl command with the token in the header and the service_id in the URL path as shown in the following example:

    curl -X POST -H "Fastly-Key:DMDf1ryoZiERdryIxQAb4seLOBqLfLMU" -H "Accept: application/json" https://api.fastly.com/service/4SsvFsxK25Z7t16kTqzu7d/purge_all
    

Drupal 8 and Drupal 9 support tag-based cache invalidation by default. The Platform CDN along with the Acquia Purge and acquia_cdn_purge modules make full use of it. For more information, see the Acquia Knowledge Base article Acquia Purge & cache tags invalidation. Any edits you make to content will cause only that content to be purged from all the caches, including the Platform CDN cache.

If you need to purge all content from all caches, then use Drupal’s Clear All Caches option which also clears the Platform CDN cache.

Drupal 7 doesn’t support tag-based invalidation by default. If you need your website to reflect a particular edit before cached content expires, you can trigger a full purge of the Platform CDN cache through the following curl command:

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

Use the API Key and Service ID values provided to you by Acquia.

Before manually purging the Platform CDN cache, purge your Varnish cache to ensure cache consistency.

Acquia Cloud Platform CDN provisioning schedule

The Acquia Cloud Platform CDN provisioning request schedule is as follows:

Acquia Cloud Platform CDN requests must include:

  • A list of all custom domains that should be provisioned for use on the Acquia Cloud Platform CDN.

    Note

    • Before provisioning, subscribers must configure all websites for use on Acquia Cloud.
    • Default acquia-sites.com domains are not eligible for use on the Acquia Cloud Platform CDN.
    • Bare domains and www subdomains must be listed individually.
  • All custom domains that will use SSL must have valid SSL certificates uploaded and active in Acquia Cloud.