WSDOT / wsdot-website

Codebase for WSDOT's public Drupal 7 website hosted on Acquia.
0 stars 4 forks source link

Purging Varnish cache on Acquia Cloud #521

Closed waynedyck closed 3 years ago

waynedyck commented 4 years ago

Dealing with the different layers of caching in Drupal has been an issue since day one. We tell users it will typically take approximately 20-30 minutes until their updated content is displayed because of caching. There are also other issues I suspect are specifically related to the varnish cache like when we need to replace a file or image and the updated version refuses to show.

The existing caching issue is causing more of a problem with the Ferries homepage redesign. The new homepage features a custom "Ferry alerts" box which is supposed to display the most recent alert. The problem is, the block and page get cached and from my recent observations, it can take hours for any new alerts to be displayed.

While trying to figure out where the page was being cached I found the Acquia article, Varnish cache HITS and Drupal cache MISS which led me to, How to purge cached pages in Varnish: Purging Varnish cache on Acquia Cloud.

Acquia Purge is a module which features a convenient way to purge caches. It provides a non-programmatic way to purge Varnish-powered balancers through a UI.

More information about installing and using Acquia Purge can be found in the Acquia Purge documentation.

waynedyck commented 4 years ago

Acquia Purge domain detection allows you to control which domains will be purged.

Whenever the Acquia Purge module tries to refresh pages (for example, news or ) on your site, it has to reconstruct URLs and determine which domains associated with your site should be cleaned. For most simple Drupal sites running on Acquia Cloud, this is adequate and it will just purge your primary domain name.

As the list of automatically detected domains grows larger, it is often necessary to tell Acquia Purge what domains it should clear. This often happens with multisite setups or single sites with many aliased domain names. To prevent downtimes or safety shutdowns, you should aim to purge no more than one to four domains. The module will self-shutdown whenever it detects more than eight domains.

waynedyck commented 3 years ago

Updated the settings.php file to only purge the following two domains:

In addition to the Acquia specific domains for each environment.