acquia flush varnish menu options

Summary

The "Acquia Flush Varnish" module offers a user-friendly interface within Drupal's admin section. It enables manual purging of the Acquia Cloud Varnish and Platform CDN (if Platform CDN is enabled) cache via the Acquia Cloud API. This functionality allows developers to clear the cache at the domain level, saving time and simplifying the workflow.

Requirements

No specific requirements are needed for this module. It works seamlessly with your existing Drupal installation.

Restrictions

It only works for Acquia cloud or Acquia site factory hosted sites.

Installation

  1. Install the module as you would with any other Drupal module.
  2. Enable the Acquia Flush Varnish module in the Drupal admin.

Configuration

To configure the module, follow these steps:

  1. Add your Acquia Cloud API credentials to the Acquia server via SSH.
  2. Note: It is not recommended to store the API key and secret in the codebase or database. Instead, use the secrets.settings.php method to set up the API key and secret in Acquia Cloud or Site Factory (Acquia's recommended approach).
  3. Reference: [Acquia Document Link] (https://docs.acquia.com/secrets#section-secretssettingsphp-file)

Setting Up secrets.settings.php

Create a secrets.settings.php file with the following structure in the Acquia server's nobackup location. Then include it in settings.php (for Acquia Cloud) or the factory hook (for Acquia Site Factory):

<?php
/**
 * @file
 * File to store Acquia API details.
 */
$config['acquia_flush_varnish.settings']['acquiacloud_apikey'] = 'xxxxxx';
$config['acquia_flush_varnish.settings']['acquiacloud_secret'] = 'xxxxxxxx-yyyyy';

Frequently Asked Questions (FAQ)

Q: How do I obtain Acquia Cloud API credentials?

A: Follow these steps:

  1. Log in to Acquia Accounts using your Acquia account credentials.
  2. Navigate to Accounts > API Tokens.
  3. Create a new API key and secret in the API Tokens tab.

Enhanced Functionality with AcquiaCloud Utility Service for API Endpoint Interaction

In addition to cache clearing, users can leverage the AcquiaCloud utility service to interact with various Acquia Cloud API endpoints using either the POST or GET method in their custom modules.

$acquiaCloudUtility = \Drupal::service('acquia_flush_varnish.cloudutility');
$accessToken = $acquiaCloudUtility->getAccessToken();
$acquiaCloudUtility->getAcquiaApi($apiUrl, $accessToken, 'POST', $data); 

Contact

Current maintainers:

Supporting organizations: 

Project information

Releases