3

im working in an acquia cloud environment and currently im clearing the varnish cache via the web interface. is there a drush command to clear varnish cache while using an acquia environment.

  • Is there something about the acquia environment that prevents vp (Varnish Purge) and/or vpa (Varnish Purge All) from working? – Adam Balsam Dec 17 '13 at 21:02
  • actually that command does not exists – Patoshi パトシ Dec 18 '13 at 15:27
  • hmmm. This commit and its associated issue seem to indicate otherwise. Maybe they didn't make it in to 7.x? I find that unlikely though. – Adam Balsam Dec 18 '13 at 15:57
5

Yep! On Acquia the command is ac-domain-purge. Here is a snippet from the drush help available from the Acquia box.

$ drush help ac-domain-purge

Purge a domain from the Varnish cache.

Arguments:
 domain              Domain name. 

Options:
 --username          Acquia Cloud API username                                                                                                                  
 --password          Acquia Cloud API password                                                                                                                  
 --acapi-conf-path   Acquia Cloud API config files location. If not specified config will be loaded from $HOME/.drush                                           
 --caller            Acquia Cloud API caller name. Default is the current username.                                                                             
 --endpoint          Acquia Cloud API endpoint URL.                                                                                                             
 --cainfo            Path to a file containing the SSL certificates needed to verify the ac-api-endpoint.                                                       
 --format            Format to output the object. Use "print_r" for print_r, "export" for var_export, and "json" for JSON. If not provided, the output is printed in a human-readable format.

Additionally, if you want to do this programmatically without drush, Acquia have an API endpoint for clearing the varnish cache.

  • how do you clear cache and varnish together? right now i have to clear the cache first and then again for varnish. – Patoshi パトシ Jan 26 '17 at 16:46
  • Just some note: this isn't shown when in a drupalroot. But works from home directory. – icasimpan Sep 3 '17 at 2:11
1

There is also a module for that called appropriately "Acquia Purge". Works perfectly. Details from project page:

The Acquia Purge module allows Drupal sites hosted on Acquia Cloud to automatically purge (wipe) pages from their Varnish powered load balancers, as soon as content actually changed. The higher Drupal's "expiration of cached pages"-setting (TTL) is configured the more your site will be served directly off your load balancers. This effectively increases the efficiency of your site and lowers hardware costs, leaving more resources for back-end traffic. In most scenarios the module offers a full turn-key experience without requiring any technical configuration.

I know this doesn't answer the actual question, but its a really easy way to purge varnish cache on acquia cloud using the rules and cache expiration module as dependencies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.