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['acqcloudapi.settings']['acquiacloud_apikey'] = 'xxxxxx';
$config['acqcloudapi.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

  • Module categories: Administration Tools, Developer Tools, Integrations
  • chart icon75 sites report using this module
  • Created by cbuvaneswaran on , updated
  • Arrow iconDrupal 10 is here!
    • Drupal 9 and 10 Support: This release brings compatibility with both Drupal 9 and Drupal 10, allowing users to seamlessly integrate the module with their latest Drupal installations.
    • Enhanced Security: Implemented Acquia recommended secret settings approach to replace the storage of API key and secret. This ensures a more secure storage mechanism, aligning with best practices recommended by Acquia for safeguarding sensitive information.
    • Refactored Controller to Services: The controller has been removed and replaced with services. This architectural change enhances the modularity and maintainability of the module. Additionally, dependency injection has been utilized to streamline service integration, promoting better code organization and scalability.
  • shieldStable releases for this project are covered by the security advisory policy.
    Look for the shield icon below.

Releases