---
title: "Manually purging a page from Varnish cache"
date: "2024-02-14T06:18:38+00:00"
summary: "Learn how to manually purge specific pages from Varnish cache using Acquia Purge or command-line methods. Optimize your Drupal site's performance with step-by-step instructions for efficient cache management."
image:
type: "page"
url: "/acquia-cloud-platform/manually-purging-page-varnish-cache"
id: "6f9bf099-c78a-4227-b9d0-649a1647ea8b"
---

Important

Acquia recommends that you use the [Acquia Purge](https://www.drupal.org/project/acquia_purge) module as the preferred method for Varnish® cache purging. For more information, see [Purging Varnish cache on Cloud Platform](/acquia-cloud-platform/performance/varnish/purging).

Varnish caching protects your application and provides content to users. Sometimes it continues to provide content to users even if your application is down for a short period. In certain scenarios, you need to remove content faster than the standard Varnish timeout for your application. Acquia recommends that you use the [Acquia Purge (recommended)](#acquia-purge) method to clear your Varnish cache in certain situations where you need to modify content faster than the standard Varnish timeout for your application.

Alternatively, you can use the [Command line](#command-line) method to manually purge content from Varnish cache through `drush`. However, it is not a recommended method.

Acquia Purge (recommended)
--------------------------

The [Acquia Purge](https://www.drupal.org/project/acquia_purge) module is the recommended method to clear specific pages or all pages from Varnish cache. For information about how to install and configure this module, visit [Installing Acquia Purge](/acquia-cloud-platform/help/94206-installing-acquia-purge-drupal-7x "Installing Acquia Purge for Drupal 7.x").

Command line
------------

If you choose to use this alternative method, read the following considerations before you begin:

*   Varnish stores caches for each domain individually. If you configure multiple domains, such as  `www.mysite.com` and `cms.mysite.com`, to reference the same application, you must make individual `drush` requests for each domain referencing the page that you want to clear from Varnish cache.
    
    When you run the purge commands on this page, it does not invalidate Drupal caches. If Drupal cache objects are not scheduled for purging from the cache and Memcache, purging the Varnish cache does not make any difference. As a result, you must clear the relevant cache id (CID) for the cache objects that you want to purge first.
    
*   Do not clear all Drupal caches because a complete cache clear might negatively affect the performance of your application while caches are rebuilt.
    

For more information about the different layers of caching, visit [Caching overview](/acquia-cloud-platform/help/92871-caching-overview "Caching overview").

### Manually purging content through drush

To complete this operation, you must first add the required processor:

    
     drush p:processor-add drush_purge_invalidate
    

To manually purge a path through `drush`, run the following command:

     
     drush p:invalidate 	
    

*   The `drush p:invalidate` command invalidates an item before it goes through the queue and takes `type` as the argument. This argument decides the type of invalidation to be performed, for example: tag, path, or url.
    

This command has the following aliases:

*   pinv
*   p-invalidate

It has the following option:

    
     --format[=FORMAT]  [default: string]
     

It has the following Global options:

    
     -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3   	for debug
     -y, --yes Auto-accept the default for all user prompts. Equivalent to --no-interaction.
     -l, --uri=URI A base URL for building links and selecting a multi-site. Defaults to https://default.
                  

Note

To see all global options, run `drush topic` and pick the first choice.

The following example clears URLs tagged with "node:1" from external caching platforms.

    
     drush p:invalidate tag node:1
    

The following example clears "http://www.drupal.org/" from external caching platforms.

    
     drush p:invalidate url http://www.drupal.org/
      

For Site Factory subscribers

Site Factory subscribers _must_ use this version of the command, which replaces `prod` with the appropriate [realm](https://docs.acquia.com/definitions/realm "https://docs.acquia.com/definitions/realm"). If you need help to determine the correct realm for your subscription, [create a Support ticket](https://docs.acquia.com/service-offerings/support#contact-acquia-support "https://docs.acquia.com/service-offerings/support#contact-acquia-support").