A site I administer currently uses the purge and acquia_purge modules to manage our varnish cache invalidation. From time to time we have a situation where a single URL fails to invalidate after a change, which I resolve using drush's p:invalidate directive. However, our content creators have requested having the ability to flush the cache like this on their own. Since they don't have access to a CLI and drush, I'm in the position of trying to find a way to allow them to invalidate a URL's cache entry in the event of a glitch.

Does this module support anything along these lines?

For reference, the site is running drupal/core 8.8.4 on acquia, with a varnish cache. The content creators are all authenticated and logged in. Ideally, I'd like to give them an interface that accepts a single URL that needs to be flushed from the varnish cache. Any help in what the best way to accomplish this would be most appreciated.

Originally I thought I could create a custom module that would call drush's p:invalidate command, but I have discovered that calling drush from a drupal module is not so easy to accomplish.

Comments

mefron created an issue. See original summary.

dungahk’s picture

You could potentially copy the code from the Drush command to your custom module, but that is far away from ideal, but if really needed, that would be the only way I am afraid.

With that being said, I would love to have that option too, as my customers have just asked about this as well.

dungahk’s picture

Hi @mefron, this is actually possible as far as I can tell! This was added as part of https://www.drupal.org/project/purge/issues/2791387

In order to enable it, you need to go into your block structure:

https://your.site/admin/structure/block

Choose a region to place the block, then on the block list, look for the "Purge this page" block and configure it. The configuration will rely on the purger you have installed, you mentioned you are using Acquia Purge so that should allow you to clear by URL as you need.

With that being said, I am closing this issue.

dungahk’s picture

Assigned: Unassigned » dungahk
Status: Active » Closed (duplicate)