· drupal · 2 min read

When the Drupal cache won't auto-purge, you must purge the Purge module

Share:

A few years ago, on at least two Drupal 8 websites, we noticed problems where the page/site cache is not automatically clearing when new content is added. This then requires a manual clearing of the varnish cache to show updated content.

A few years ago, on at least two Drupal 8 websites, we noticed problems where the page/site cache is not automatically clearing when new content is added. This then requires a manual clearing of the varnish cache to show updated content.

After researching this problem, I found that the Purge Module is getting gummed up with an overwhelming queue of things to clear. This may be caused by unprocessed cron operations or other rare incidents that do not bubble up in an obvious manner.

As you can see in the screenshot, it is reporting that there are more items in the queue than it can process and thus locks its operations and refuses to clear the cache any further.

To find this screen, go to: Administration > Configuration > Development > Performance

Once in there, click on the “Purge” tab at the top. Then scroll down, looking on the right for the Queue Size. If you see it in red with an error message then you are experiencing the very same problem.

The fix for this is simple if you have command line access and Drush setup properly. Go to your site’s folder and run `drush @[site].[environment] pqe` (example: `drush @mysite.prod pqe`). This will empty the queue.

You may also do this from the Purge page (listed above) by expanding the “QUEUE” section. Then click the dropdown next to “Database” and click “Empty”.

Share:
Back to Blog