Hi,
I'd like to add the ability to blacklist cache tags, as well as URL fragments.

The need for this comes from the node_list cache tag appearing on too many pages. Even though this module queues up requests to purge a URL, it uses cache tags to figure out which ones to purge.

I am going to attempt to copy the way the purge_queuer_coretags module does this, and will attach the patch here.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rgristroph created an issue. See original summary.

rgristroph’s picture

StatusFileSize
new9.38 KB

Here's a first attempt at at patch. Would love to hear feedback.

kylesloan2’s picture

I ran into the same issue where a public search form would make a new entry and keep compounding. Every time an admin would edit a page, every search ever done would be put into the purge queue table. I also saw the edit urls for admins were making it into the queue. I will test this out later today and let you know if it works for me.

Thanks for submitting a patch.

kylesloan2’s picture

Hm I applied the patch, uninstall/re-installed module, cleared drupal cache, and am not seeing any configuration options in the drupal back office anywhere. What is the URL I can hit to see if the config screen is working?

tannerg’s picture

/admin/config/development/performance/purge

Click "Add queuer" and select and "URL queuer"

You should see an extra set of configurations at the bottom of the modal that pops up.

It worked for me.

kylesloan2’s picture

Thank you for those directions to getting to the admin side.

I tested and all the options worked for me.

Thanks for all the work on this.

rgristroph’s picture

Status: Active » Needs review

Just bumping this . . . it has been used and reviewed by the people on the team I work with, but maybe with another review it could go to RTBC ?

bsains’s picture

StatusFileSize
new9.38 KB
new2.52 KB

@rgristroph 2 Issues here -

1. Incorrect config form variable name for setting - line 108 was blacklist_items_tags_count instead of blacklist_tags_items_count - this blocked the addition of more than one cache tag to the black list.

2. Having no items in the blacklist returned an empty set of cache tags in applyTagsBlacklist, which in turn caused 500 errors.

I've rerolled the patch and attached an interdiff.

gordon’s picture

StatusFileSize
new9.43 KB
new10.24 KB

rerolled for 1.0

gordon’s picture

StatusFileSize
new9.43 KB
new10.23 KB

Fix up an issue I found in the reroll.

agilmore87’s picture

StatusFileSize
new1.71 KB
new9 KB

Hi, small issue with the patch, it will add an allowed tag to the array of cleaned tags once for every prefix checked, so I'm getting duplicate tags in the database. I'm attaching an update to the patch to fix this.

Kolin made their first commit to this issue’s fork.

kolin’s picture

We should also respect the blacklist when queueing urls for purging.
This will allow for blacklisted tags to be added when there are already items in the traffic registry.