Information for: DEVELOPERS   PARTNERS

Purging Varnish cache on Cloud Platform

Having long cache lifetimes and expire times has major advantages, which means that it’s important to use Varnish® with Drupal for performance improvements. However, when changes are made or new content is published, you don’t want to wait a long time for visitors (including non-authenticated users) to see the changes. In these cases, you should periodically purge your Varnish cache.

Varnish excels at storing pages, CSS, JavaScript files, and multimedia files for as long as possible, so that visitor requests don’t hit the back-end (in most scenarios, this will be Apache). This greatly helps with performance and allows an application to scale much better than it would if only Apache was serving pages. When your organization decides to implement a caching strategy, you will need to explore all available options and decide what’s best for your situation. For more information, see Using Varnish.

Select from the following methods to purge your Varnish cache:

Using Acquia Purge

The Acquia Purge module is the fastest and most convenient way to purge Varnish cache on Cloud Platform. Acquia Purge works within your Drupal application to clear Varnish cache on Cloud Platform and works with other modules to update caches and external caching layers.

Drupal 8 and Drupal 9

Tag-based Varnish cache invalidation is a performance enhancement available to Drupal 8 and Drupal 9 websites on Cloud Platform. See Drupal 8 Acquia Purge & cache tags invalidation for information about installing and using Acquia Purge for Drupal 8.

Drupal 7

Acquia Purge provides a non-programmatic way to purge Varnish-powered load balancers using a user interface. It integrates the Rules and Cache Expiration for extra flexibility and proactive purging.

For more information about installing and using Acquia Purge for Drupal 7, see Acquia Purge page on


For the official documentation for the Acquia Purge module, go to You should file any module specific issues on For Acquia Support related issues, contact Acquia support.

Purging programmatically

While Acquia Purge is the best method when it comes to implementing a caching strategy, another good method is to use the Purge and Cache Expiration modules.

The Purge module clears URLs from reverse proxy caches like Varnish and also issues an http PURGE request to them. It works with the Cache Expiration module to act on events that are likely to expire URLs from the proxy cache and interact with Rules and Drush. This results in delivering faster content updates to end users. Acquia Purge is recommended on Cloud Platform because it has many of the same features, and the maintainers for Purge and Acquia Purge work closely to ensure compatibility.

If you absolutely must purge a page manually from Cloud Platform, you can learn how to manually purge a page.

Using the Cloud Platform API

Acquia has developed the Cloud Platform API to enable developers to take advantage of even more automation as part of their daily workflow. The Cloud Platform API is a RESTful web interface that allows developers to extend, enhance, and customize Cloud Platform. It includes developer workflow, application management, and provisioning capabilities. Of all its commands, the relevant one here is the delete the domain cache instance method:

DELETE /sites/:site/envs/:env/domains/:domain/cache

The preceding command triggers a Varnish cache purge for a specific domain. It works exactly like clearing the cache for a domain using the Cloud Platform interface, as described in Clearing the Varnish cache. Here’s an example:

curl -s -u user:pass -X DELETE \

For more information about the Cloud Platform API, see Developing with the Cloud Platform API, and review the Cloud API documentation.

Using Cloud Platform Hooks

Cloud Hooks allow you to automate almost anything as part of your workflow actions. A Cloud Hook is a script in your code repository that Cloud Platform executes on your behalf when a triggering action occurs (for example, when a database, some code or some files are copied from one environment to the other). You can implement Cloud API Varnish cache clears as part of Cloud Hooks triggers, for instance when you are deploying code from the Development to the Staging .


Acquia strongly recommends that you use extreme caution when purging the Varnish cache on a production domain.

For more information about Cloud Platform Hooks, see Automating with Cloud Hooks, and check out the Cloud Hooks GitHub repository.

Using other purge methods

Although Acquia Purge is the preferred and safest method of cache purging, there are some other methods that you can use if necessary: