Acquia Flush Varnish
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
- Install the module as you would with any other Drupal module.
- Enable the Acquia Flush Varnish module in the Drupal admin.
Configuration
To configure the module, follow these steps:
- Add your Acquia Cloud API credentials to the Acquia server via SSH.
- Note: It is not recommended to store the API key and secret in the codebase or database. Instead, use the
secrets.settings.phpmethod to set up the API key and secret in Acquia Cloud or Site Factory (Acquia's recommended approach). - 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:
- Log in to Acquia Accounts using your Acquia account credentials.
- Navigate to Accounts > API Tokens.
- 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:
- Buvaneswaran (buvan) - Drupal.org Profile
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 2.0.4 | Stable | updated code quality using phpcs and dependency injection. | Nov 14, 2024 |