Drupal is a registered trademark of Dries Buytaert
Release: Drupal 11.4.5 Update released for Drupal core (11.4.5)! Release: Drupal 10.6.15 Update released for Drupal core (10.6.15)! Release: Superfish Dropdown Menu 8.x-1.15 Minor update available for module superfish (8.x-1.15). Release: Leaflet 10.4.10 Minor update available for module leaflet (10.4.10). Release: Raven: Sentry Integration 7.5.1 Minor update available for module raven (7.5.1). Release: htmLawed 8.x-3.8 Minor update available for module htmlawed (8.x-3.8). Release: Raven: Sentry Integration 7.5.0 Minor update available for module raven (7.5.0). Module Revived: Media Library Form API Element 2.1.5 Module media_library_form_element updated after 10 months of inactivity (2.1.5). Release: Acquia Content Optimization 2.1.0-alpha1 First alpha version released for module conductor (2.1.0-alpha1). Usage Milestone: Manage display Module manage_display crossed 1,000 active installs.

This module allows you to manage your Varnish cache on Acquia Cloud Platform directly from your Drupal site. You can clear caches through a web interface or Drush commands, with options to target specific domains or all domains within your environment.

Acquia Purge Varnish provides seamless Varnish cache management for Acquia Cloud Platform directly from your Drupal site. Built with modern Drupal standards and leveraging Acquia's Cloud API v2, this module enables administrators to clear Varnish caches through an intuitive web interface or comprehensive Drush commands.

Key Features

  • Web UI & Drush Support – Manage cache purging via admin interface or powerful CLI commands
  • Acquia Cloud API v2 – Built with the latest API version as recommended by Acquia
  • Flexible Domain Purging – Clear cache for current domain only or all domains in the environment
  • OAuth2 Authentication – Secure API communication using industry-standard authentication
  • Environment Auto-Detection – Automatically detects and works with your current Acquia environment
  • Settings.php Override – Secure credential management for production environments
  • Comprehensive Logging – Optional request logging for debugging and monitoring
  • Permission-Based Access – Role-based access control for cache management

Security

Security is built into every aspect of this module:

  • CSRF Protection – All routes protected with Drupal's CSRF token system
  • OAuth2 Authentication – Secure API authentication flow
  • Guzzle HTTP Client – Uses Drupal core's secure HTTP client (more info)
  • Strict Type Safety – PHP strict types throughout for runtime safety
  • Credential Protection – API credentials never exposed in logs or UI (unless explicitly enabled)
  • Clean Uninstall – All configuration and credentials removed on module uninstall

Drush Commands

Complete CLI integration with Drush:

  • drush apv-purge – Purge Varnish cache with optional domain targeting
  • drush apv-status – Display environment and configuration status
  • drush apv-domains – List all domains (supports JSON/YAML output)
  • drush apv-test – Test API credentials and connectivity
  • drush apv-config – Configure module settings via CLI

Requirements

  • Drupal: 10.x or 11.x
  • Platform: Acquia Cloud Platform (dev, stage, or prod environment)
  • Credentials: Acquia Cloud API Key and API Secret with cache-clearing permissions
  • Drush: 13.x (optional, for CLI commands)

Configuration

Option 1: Web UI

Navigate to Configuration → Acquia Purge Varnish → Settings

/admin/config/acquia-purge/settings

Option 2: Drush Commands

<pre class="codeblock"><code class="language-php">drush apv-config --api-key="YOUR_KEY" --api-secret="YOUR_SECRET"
drush apv-config --domain=all

Option 3: Settings.php Override (Recommended for Production)

<pre class="codeblock"><code class="language-php">$settings['acquia_purge_varnish_credentials'] = [
  'api_key' =&gt; 'your-acquia-api-key',
  'api_secret' =&gt; 'your-acquia-api-secret',
  'application_name' =&gt; 'your-app-name', // Optional - auto-detects from AH_SITE_GROUP
];

When using settings.php override, form fields are automatically disabled with an override notice.

Getting API Credentials

  1. Log in to Acquia Cloud Platform
  2. Navigate to Profile → API Tokens
  3. Click "Create Token" and provide a descriptive label
  4. Copy the API Key and API Secret immediately (Secret shown only once)
  5. Ensure your Acquia account has permissions to clear caches

Multiple Applications Support

The module automatically detects your application name from AH_SITE_GROUP. If you have multiple Acquia applications or need to override the detection, simply enter your application name in the configuration form. Learn more about Acquia application management.

Usage Examples

Web Interface:

Navigate to Configuration → Acquia Purge Varnish → Purge varnish and click the purge button.

Drush Commands:

<pre class="codeblock"><code class="language-php"># Purge all domains in current environment
drush apv-purge --domain=all

# Purge only current domain
drush apv-purge --domain=current

# Check status before purging
drush apv-status

# Test credentials
drush apv-test

# List all available domains
drush apv-domains --format=json

Automation (Post-Deployment Hook):

<pre class="codeblock"><code class="language-php">#!/bin/bash
# hooks/common/post-code-deploy/purge-varnish.sh
site="$1"
target_env="$2"
drush @$site.$target_env apv-purge --domain=all

Permissions

Grant the "Administer Acquia Purge Varnish" permission to appropriate roles at:

People → Permissions (/admin/people/permissions)

This permission controls access to configuration, manual purging, and all Drush commands.

Modern Architecture

  • Drupal 11 Standards – Fully compliant with modern Drupal best practices
  • Dependency Injection – Service-based architecture throughout
  • Strict Type Safety – PHP 8 strict types for enhanced reliability
  • Configuration Schema – Properly defined configuration structure
  • Comprehensive Error Handling – Graceful handling of API failures
  • PSR-4 Autoloading – Standard PHP autoloading practices

Documentation

Upgrade from Previous Versions

Upgrading is seamless with automatic migration:

  • Permission machine name updated automatically via update hook
  • All existing configuration preserved
  • New Drush commands immediately available
  • Backward compatible with existing integrations

Legal Disclaimer

This module has not been developed, maintained, or endorsed by Acquia Inc. This is an independent open-source project with no affiliation to Acquia Inc. The module integrates with the publicly available Acquia Cloud Platform API as documented at cloudapi-docs.acquia.com.

Support and maintenance

Questions, ideas, and bug reports are welcome. Please use this project’s issue queue so discussions and solutions remain available to the Drupal community.

Maintainers monitor issues, but response times depend on availability.

Developed and maintained by Alaa Haddad of Flash Web Center, LLC.

AI disclosure: AI tools assisted with drafting and reviewing this project description. The maintainer verified the final content against the project source.

Activity

Tracked releases
4
Tracked since
Jan 2025
Latest release
1 month ago
Releases (12 mo)
3 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Release date
3.0.0 Stable Jun 27, 2026
3.0.0-beta1 Pre-release Oct 17, 2025
3.0.x-dev Dev Oct 15, 2025
2.0.1 Stable Jan 21, 2025