Skip to header Skip to main navigation Skip to main content Skip to footer
Cookies UI
Site branding
Alaa Haddad - Drupal Expert
Consultant • Architect • Developer • Themer - Expert Drupal Solutions
Main navigation
Alaa Haddad Offers Exceptional Drupal Custom Theming and Modules in Austin TX Alaa Haddad - Drupal Expert
  • Professional Profile
  • Drupal Services
    • Drupal Development
    • Drupal Developer
    • Drupal Themer
    • Drupal Architect
    • Drupal Consultant
  • My Drupal Modules & Themes
      • Cloudflare Purge
      • Solo Copy Blocks
      • W3CSS Paragraphs
      • Paragraphs Bundles
      • Acquia Purge Varnish
      • Reference Blocked Users
      • Module Matrix
      • Paragraphs Bundles Import
      • Selectify
      • Solo Utilities
      • Utilikit
      • Solo
      • Amun
      • Anhur
      • Amunet
      • W3CSS Theme
      • 3D Carousel
      • 3D FlipBox
      • Accordion
      • Carousel
      • Hero
      • Lightbox
      • Parallax
      • Reveal
      • Slideshow
      • Tabs
  • Blog
  • Videos
  • Contact
  • Hire Me (opens in new tab)

Acquia Purge Varnish - API V2 (Drupal Module)

Breadcrumbs

Breadcrumb

  • Home
  • Drupal Modules
  • Acquia Purge Varnish - API V2 (Drupal Module)

Main page content

Alaa Haddad, professional Drupal developer based in Austin, TX   Alaa Haddad
  11:00 PM CDT, Sun September 13, 2026
Share

Acquia Purge Varnish clears the Varnish cache on Acquia Cloud Platform from a Drupal admin form, Drush, or a post-deployment hook, authenticating against Acquia's Cloud API v2 with an OAuth2 client-credentials grant. It declares core_version_requirement: ^10 || ^11 || ^12, so it already runs on Drupal 12, and it is free on drupal.org.

What it does

Acquia's platform sits Varnish in front of every environment. After a deploy, a config import, or a content push between environments, the cache in front of your site is still serving the old response until something purges it. This module is that purge button — reachable from the admin interface, from Drush for automation, or from an Acquia Cloud Platform hook script that fires on every deploy.

It talks to Acquia's Cloud API v2 through GuzzleHttp\ClientInterface — Drupal core's own HTTP client — so no additional HTTP library is pulled in for the request layer itself.

Requirements

Requirements, read from acquia_purge_varnish.info.yml
RequirementValue
Drupal core^10 || ^11 || ^12
PHP^8.1
PlatformAcquia Cloud Platform (dev, stage, or prod)
CredentialsAn Acquia Cloud API key and secret with cache-clearing permission

Authentication, and one thing to fix before you install

The module authenticates with the OAuth2 client-credentials grant, using League\OAuth2\Client\Provider\GenericProvider against https://accounts.acquia.com/api/auth/oauth/token. There is no CSRF token exchange in the authentication path — that would be the wrong mechanism for a server-to-server API call — and the module does not use one there. A CSRF token does guard the purge action route itself (/admin/config/acquia-purge/varnish), which is the form submission a signed-in administrator triggers, not the API call the module makes on Acquia's behalf.

The dependency this needs is not declared in composer.json. The module's own requirements check — both at install time and on every subsequent status report — looks for League\OAuth2\Client\Provider\GenericProvider and refuses to let the module stay enabled if the class cannot be autoloaded. But nothing in composer.json pulls league/oauth2-client in for you. If Composer has not already installed it as a dependency of something else on your site, install fails with an error naming the missing library. Run this once, before or right after you require the module:

composer require league/oauth2-client:^2.7

This is a real gap in the module's own dependency declaration, not a hypothetical — treat it as a required manual step rather than an oversight you can ignore.

Installing and configuring

composer require drupal/acquia_purge_varnish
composer require league/oauth2-client:^2.7
drush en acquia_purge_varnish -y

Credentials come from Acquia Cloud → Profile → API Tokens. Create a token, copy the key and secret immediately — the secret is shown once — and confirm the account can clear caches on the target application.

Three ways to supply them:

The settings form
/admin/config/acquia-purge/settings, gated behind the Administer Acquia Purge Varnish permission.
Drush
drush acquia-purge-varnish:config --api-key="KEY" --api-secret="SECRET"
settings.php
The recommended path for production, because it keeps credentials out of the config export entirely:
$settings['acquia_purge_varnish_credentials'] = [
  'api_key' => 'your-acquia-api-key',
  'api_secret' => 'your-acquia-api-secret',
  'application_name' => 'your-app-name', // optional — auto-detects from AH_SITE_GROUP
];
When this override is present, the settings form fields disable themselves and show a notice rather than silently doing nothing.

Drush commands

Drush commands, from AcquiaPurgeVarnishCommands.php
CommandAliasDoes
acquia-purge-varnish:purgeapv-purgePurge the current domain, all domains, or a custom list
acquia-purge-varnish:statusapv-statusShow environment, config and credential status
acquia-purge-varnish:list-domainsapv-domainsList every domain in the current environment (table, JSON or YAML)
acquia-purge-varnish:configapv-configSet credentials, domain mode and logging from the CLI
acquia-purge-varnish:test-credentialsapv-testConfirm the API key and secret actually authenticate

Choosing what gets purged

The --domain option, or the equivalent config setting, takes three values: current purges only the domain that served the request, all purges every domain in the environment, and custom purges a fixed list you supply with --custom-domains or --domains. A custom list is filtered against the domains that actually exist in the matched environment before the request goes out, so a typo in the list does not silently fail — it falls back to purging the current domain instead.

drush apv-purge --domain=all
drush apv-purge --domain=current
drush apv-domains --format=json

For an automated purge on every deploy, an Acquia Cloud Platform hook script is the standard place:

#!/bin/bash
# hooks/common/post-code-deploy/purge-varnish.sh
site="$1"
target_env="$2"
drush @$site.$target_env apv-purge --domain=all

Common questions

Will this work off Acquia Cloud Platform?

No. Every command checks AH_SITE_ENVIRONMENT and refuses to run when it is not set. The module is built specifically around Acquia's Cloud API and environment variables.

Why did my install fail on a fresh site?

Almost certainly the missing league/oauth2-client dependency described above. Run composer require league/oauth2-client:^2.7 and try again.

Is this affiliated with Acquia?

No. It is an independent open-source project that talks to Acquia's publicly documented Cloud API; it has not been developed or endorsed by Acquia Inc.

Does it work on Drupal 12?

Yes — ^10 || ^11 || ^12 — and its status-report logic was specifically rewritten for Drupal 12's removal of the old requirement constants, so the OAuth-library check keeps working rather than silently passing.

Can I purge more than one application's domains at once?

Not in one command. Each Drush invocation targets one Acquia application, matched by name; run it once per application, or loop it in your own deploy script.

Need Acquia or Varnish work done properly?

Acquia Purge Varnish is free and will stay that way. If you want help wiring cache purging into a real deploy pipeline, sorting out an Acquia Cloud Platform migration, or a Drupal 11 or 12 upgrade that this kind of integration depends on, that is the work I do day to day.

See my Drupal services, read about what a Drupal developer brings to a project, or get in touch to talk about your environment.

Acquia Purge Varnish - API V2
Slide 1 of 27
Acquia Purge Varnish - API V2 (Drupal Module)
Slide 2 of 27
Amun - W3CSS Sub-Theme (Drupal Theme)
Slide 3 of 27
Amunet - W3CSS Sub-Theme (Drupal Theme)
Slide 4 of 27
Anhur - W3CSS Sub-Theme (Drupal Theme)
Slide 5 of 27
Cloudflare Purge (Drupal Module)
Slide 6 of 27
Module Matrix (Drupal Module)
Slide 7 of 27
Paragraphs Bundles (Drupal Module)
Slide 8 of 27
Paragraphs Bundles Import (Drupal Module)
Slide 9 of 27
Reference Blocked Users (Drupal Module)
Slide 10 of 27
Selectify (Drupal Module)
Slide 11 of 27
Solo (Drupal Theme)
Slide 12 of 27
Solo Copy Blocks (Drupal Module)
Slide 13 of 27
Solo Utilities (Drupal Module)
Slide 14 of 27
Utilikit (Drupal Module)
Slide 15 of 27
Views 3D Carousel (Drupal Module)
Slide 16 of 27
Views 3D FlipBox (Drupal Module)
Slide 17 of 27
Views Accordion (Drupal Module)
Slide 18 of 27
Views Carousel (Drupal Module)
Slide 19 of 27
Views Hero (Drupal Module)
Slide 20 of 27
Views Lightbox (Drupal Module)
Slide 21 of 27
Views Parallax (Drupal Module)
Slide 22 of 27
Views Reveal (Drupal Module)
Slide 23 of 27
Views Slideshow (Drupal Module)
Slide 24 of 27
Views Tabs (Drupal Module)
Slide 25 of 27
VVJ Core (Drupal Module)
Slide 26 of 27
W3CSS Paragraphs (Drupal Module)
Slide 27 of 27
W3CSS Theme (Drupal Theme)
1 of 27

Our mission is to make Drupal more accessible and user-friendly, empowering businesses of all sizes, especially small enterprises with powerful tools that streamline content customization and enhance digital experiences.

Need help with your Drupal project? Hire Me through Flash Web Center, LLC.

Search

The Drupal 11 Module and Theme Stack, With Versions Checked

ARIA Live Regions in Drupal 11: What Core Does, What You Add

Drupal Architect: The Decisions Expensive to Reverse

Drupal Services: Development, Theming, Upgrades | Austin TX

Paragraphs Bundles

Drupal Module - Paragraphs Bundles

Drupal Theme - Solo

Drupal Theme - Solo

Drupal Work List - Drupal Work

Reference Blocked Users (Drupal Module)

Solo Utilities (Drupal Module)

Views Hero (Drupal Module)

Solo (Drupal Theme)

Paragraphs Bundles Import (Drupal Module)

Drupal Theme - W3CSS Theme

Drupal Theme - W3CSS Theme

Drupal Module - W3CSS Paragraphs

Drupal Module - W3CSS Paragraphs

Inspiration

Inspiration is the fuel that powers our creative engine, often coming from our surroundings, experiences, or the works of others. It's that magical moment when something clicks inside your brain, and you suddenly see a path forward that you hadn't noticed before. Inspiration can strike at any time, providing the motivation and energy needed to explore new possibilities and bring your ideas to life.

Unique Ideas

Unique Ideas

Unique ideas are the seeds of innovation, representing original thoughts or concepts that stand out from the usual. They're the sparks that ignite the process of creating something new and different, often leading to unexpected and groundbreaking solutions or products. Whether in art, science, business, or technology, unique ideas challenge the status quo and pave the way for progress.

Brainstorming

Brainstorming

Brainstorming is a creative group activity designed to generate a large number of ideas or solutions to a problem. It's a free-flowing and open-ended discussion where every suggestion is welcomed and considered, no matter how outlandish it may seem. Brainstorming encourages thinking outside the box, fostering an environment where creativity and collaboration lead to innovative solutions.

Planning

Planning

Planning is the blueprint for turning your ideas into reality. It involves setting goals, outlining steps, and organizing resources in a way that makes achieving your objectives possible. Good planning considers potential challenges and opportunities, making it easier to navigate the journey from concept to completion. It's about preparing the groundwork so that your projects can grow and flourish.

Drupal Developer

A Drupal Developer stands as the technical powerhouse behind dynamic websites, wielding expertise in PHP, custom module development, and Drupal's sophisticated API ecosystem. This role transforms business requirements into functional, secure, and scalable web solutions that power everything from small business sites to enterprise platforms serving millions of users. A Drupal Developer's expertise spans the entire development lifecycle—from architecting custom modules and integrating third-party services to optimizing performance and ensuring security compliance. Discover the complete guide to Drupal Developer skills, career paths, and hiring strategies.

Drupal Themer

A Drupal Themer serves as the artistic craftsperson who transforms wireframes and design mockups into pixel-perfect, accessible, and responsive user experiences using Twig templates, CSS, and JavaScript. This specialized role bridges the gap between design vision and technical implementation, ensuring every website not only looks exceptional but performs flawlessly across all devices and meets WCAG accessibility standards. A Drupal Themer's work encompasses the entire front-end ecosystem—from creating custom theme architectures and optimizing Core Web Vitals to implementing complex responsive designs and ensuring seamless integration with Drupal's rendering system. Explore the comprehensive guide to Drupal Themer expertise, theming best practices, and career advancement.

Drupal Architect

A Drupal Architect emerges as the strategic visionary of web construction, armed with encyclopedic knowledge of enterprise architecture patterns, infrastructure design, and Drupal's extensive technological ecosystem. This senior role operates at the highest technical level, making critical decisions that determine whether complex implementations scale successfully or collapse under real-world demands. A Drupal Architect's responsibilities begin long before development starts—during strategic planning phases where the foundation for secure, performant, and maintainable systems is established through careful evaluation of technology stacks, integration strategies, and scalability requirements. Learn about Drupal Architect skills, enterprise architecture strategies, and career progression to principal roles.

Footer menu

  • Contact
  • Professional Resume
  • Resume Summary
  • Technical Skills
  • Privacy Policy
  • Terms & Conditions
  • Search
  • Login
  • Sitemap

Copyright © 2026 Flash Web Center, LLC - All rights reserved

Developed & Designed by Alaa Haddad