Acquia Purge

broken image


Rotterdam, South Holland, Netherlands Engineering team responsible for the development of various Drupal developer focused Acquia products such as Remote IDEs, Pipelines CI, Acquia Connector. Demo module to set a special 'Acquia Cloud' cache tag header using Purge module. geerlingguy/purgeacquiacloud.

Varnish is a robust caching web service used by many high profile and high traffic websites. Acquia uses Varnish to help end users retrieve web sites faster and to help keep the load down on your servers. Once a page is in the cache performance will be fast, but what if you need to make a quick content adjustment? Now that the cached content is no longer up to date and needs to be cleaned, how can you keep your cache fresh?

What we did for our Drupal site is setup Cache Expiration with Purge modules to connect to our Varnish nodes and keep all our pages up to date. Most module like Varnish and Purge will integrate some page cleaning, but these modules don't work for cleaning Views or Panels caches. What Cache Expiration offers is a more configurable options to act on and utilize the Workflow module to update our Views. With this extra control we were more comfortable to extend our Caching time beyond what Drupal allows to you select from the pull down to 7 days. With a quick config line change in sites.php we can setup the cache time

Now that we have our pages setting the cache header to 7 days, we need to setup one of the many different Purge options that CacheExpiration offers. After install Cache Expiration go to admin/config/system/expire and select External Expiration as we are wanting to connect to our external cache server. If you are going to use Acquia Purge or Varnish uncheck 'Include Base URL in Expires'. The only sections I really needed to worry about were Node Expiration and Menu Links Expiration as we don't use Comments and our User pages are not their Drupal user account pages. For files we use Apache to send file type headers for how long the cache server can hold onto those and all of the file uploads will append _[0-9] to the file name. For Node Expiration we set all three actions Insert, Update, Delete to trigger a page cache purge. Depending on your setup you might be fine with the basic Front Page and Node Page being purged but I wanted to do something al little different and did Custom with these two URLS

Purge

The next setting that we setup was the Menu Links Expiration section. Again all actions are checked. For menu Depth, it really depends on your menu structure and what menus you have content on that will be updated more frequently, for us Main Menu with depth of 1 was all I needed.

Definition of what Menu Depth is from the maintainer:

The goal is to easily arrange for a high visibility menu to be consistent and current on all the pages the menu links to. So, if you are using a menu block with a depth of 2, you can configure this plugin to clear the URLs linked to by said menu block.

Now that we have all our nodes setup to purge when content is change as well as our menus its time to move on to our Views. The way we setup our rules to purge our Views is One rule per View, so for Feature Story we have one rule that will purge the Home page and our All Stories page.

Create a new Rule and use two events as the trigger, After Saving New content and After Updating Existing Content now with these events we filtered them by a specific content type so that way the rule will only fire for this specific pice of content, for this example I will use Feature Story as the content type. We didn't need any conditions so that was left as None. Finally down to the part that matters, the Actions. Add a new action Clear URL(s) from the Page Cache. As soon as you select this action the page will update and present you with a text box to enter in your different URL(S) you wish to purge. To continue with the Feature Story example, our site only had one URL that needed to be purge

Save and that's it. Any time someone updates a Feature Story on your site, the Node Page and the View's page will now be wiped from the Cache server and the next request to those pages will now cache the newest content.

For the home page I have a special rule to purge it from the cache anytime anything is updated on the site, you might want to make modifications to this to suite your needs.

Modules:

To create a new account, enter the email address you use for scheduling meetings. Enter the email address you use for meetings Join a meeting without an account. Chime app on pc. Amazon Web Services Login. Account owner that performs tasks requiring unrestricted access. User within an account that performs daily tasks. Root user email address. By continuing, you agree to the. This browser is not supported by Amazon Chime. For more information on browser support, please visit our support documentation. If you are using Internet Explorer.

Cache Expiration: https://www.drupal.org/project/expire

Purge: https://www.drupal.org/project/purge

Workflow: https://www.drupal.org/project/workflow

Varnish: https://www.drupal.org/project/varnish

Acquia Purge Definition

Acquia Purge: https://www.drupal.org/project/acquia_purge

Acquia Flush Varnish provides a Drupal admin side interface to manually purge 'Acquia Cloud' varnish cache. It also validates Acquia cloud credentials. We can flush varnish cache for each domain that we have. It uses the Acquia Cloud API functions for all the actions.

Acquia Purge Mask

How is this Secure?

It uses custom CSRF token in Drupal 8 and Form API confirmation in Drupal 7 for clearing varnish cache. It also uses Drupal http request for all API calls. So it's not vulnerable to CSRF exploits and avoids security risk.

How did I get this idea?

This is one of the case encountered in Global Atlantic project. We got an issue where taxonomy term updates were not reflected for anonymous user pages because of varnish cache. So we decided to create a Drupal admin side panel to purge Acquia varnish cache instead of the client having to be dependent on us to clear the cache every time. After analysing Acquia cloud API functions this module was implemented. It's also very useful module for Drupal developers and non technical people as it saves developers time while implementation.

Acquia Purge Varnish

Steps to configure the module:

  • Download and install a module as usual. See Drupal 7 and Drupal 8 for further information.
  • Go to Administration » Configuration » Acquia cloud API Credentials (/admin/config/flush-varnish).

It shows a configuration form. In that form provide your Acquia API valid credentials.(Below I have enclosed how to get Acquia credentials)

Click 'Save API Values'. It validates and displays confirmation message for your setup.

Then go to Administration » Configuration » Acquia cloud API Credentials » Acquia varnish cache to clear a varnish cache.

How to get Acquia credentials?

Login at https://accounts.acquia.com/account this URL using your Acquia account credentials. After login go to credentials tab. In credentials tab we have Acquia cloud API credentials (Email and Private Key) below 'Cloud API'.

Acquia

The next setting that we setup was the Menu Links Expiration section. Again all actions are checked. For menu Depth, it really depends on your menu structure and what menus you have content on that will be updated more frequently, for us Main Menu with depth of 1 was all I needed.

Definition of what Menu Depth is from the maintainer:

The goal is to easily arrange for a high visibility menu to be consistent and current on all the pages the menu links to. So, if you are using a menu block with a depth of 2, you can configure this plugin to clear the URLs linked to by said menu block.

Now that we have all our nodes setup to purge when content is change as well as our menus its time to move on to our Views. The way we setup our rules to purge our Views is One rule per View, so for Feature Story we have one rule that will purge the Home page and our All Stories page.

Create a new Rule and use two events as the trigger, After Saving New content and After Updating Existing Content now with these events we filtered them by a specific content type so that way the rule will only fire for this specific pice of content, for this example I will use Feature Story as the content type. We didn't need any conditions so that was left as None. Finally down to the part that matters, the Actions. Add a new action Clear URL(s) from the Page Cache. As soon as you select this action the page will update and present you with a text box to enter in your different URL(S) you wish to purge. To continue with the Feature Story example, our site only had one URL that needed to be purge

Save and that's it. Any time someone updates a Feature Story on your site, the Node Page and the View's page will now be wiped from the Cache server and the next request to those pages will now cache the newest content.

For the home page I have a special rule to purge it from the cache anytime anything is updated on the site, you might want to make modifications to this to suite your needs.

Modules:

To create a new account, enter the email address you use for scheduling meetings. Enter the email address you use for meetings Join a meeting without an account. Chime app on pc. Amazon Web Services Login. Account owner that performs tasks requiring unrestricted access. User within an account that performs daily tasks. Root user email address. By continuing, you agree to the. This browser is not supported by Amazon Chime. For more information on browser support, please visit our support documentation. If you are using Internet Explorer.

Cache Expiration: https://www.drupal.org/project/expire

Purge: https://www.drupal.org/project/purge

Workflow: https://www.drupal.org/project/workflow

Varnish: https://www.drupal.org/project/varnish

Acquia Purge Definition

Acquia Purge: https://www.drupal.org/project/acquia_purge

Acquia Flush Varnish provides a Drupal admin side interface to manually purge 'Acquia Cloud' varnish cache. It also validates Acquia cloud credentials. We can flush varnish cache for each domain that we have. It uses the Acquia Cloud API functions for all the actions.

Acquia Purge Mask

How is this Secure?

It uses custom CSRF token in Drupal 8 and Form API confirmation in Drupal 7 for clearing varnish cache. It also uses Drupal http request for all API calls. So it's not vulnerable to CSRF exploits and avoids security risk.

How did I get this idea?

This is one of the case encountered in Global Atlantic project. We got an issue where taxonomy term updates were not reflected for anonymous user pages because of varnish cache. So we decided to create a Drupal admin side panel to purge Acquia varnish cache instead of the client having to be dependent on us to clear the cache every time. After analysing Acquia cloud API functions this module was implemented. It's also very useful module for Drupal developers and non technical people as it saves developers time while implementation.

Acquia Purge Varnish

Steps to configure the module:

  • Download and install a module as usual. See Drupal 7 and Drupal 8 for further information.
  • Go to Administration » Configuration » Acquia cloud API Credentials (/admin/config/flush-varnish).

It shows a configuration form. In that form provide your Acquia API valid credentials.(Below I have enclosed how to get Acquia credentials)

Click 'Save API Values'. It validates and displays confirmation message for your setup.

Then go to Administration » Configuration » Acquia cloud API Credentials » Acquia varnish cache to clear a varnish cache.

How to get Acquia credentials?

Login at https://accounts.acquia.com/account this URL using your Acquia account credentials. After login go to credentials tab. In credentials tab we have Acquia cloud API credentials (Email and Private Key) below 'Cloud API'.

Acquia Purge Module

What are the restrictions ?

Acquia Purge Meaning

It only works for Acquia hosted sites. Copic marker drawings anime.





broken image