The configuration form (and everywhere in the code) states that the string you enter in the blacklist are used as prefixes to match against tags:
The strings are matched as prefixes, so for example config: will match tags as config:core.extension and config:block_list.
But this is the code behind the matching:
if (strpos($tag, $prefix) !== FALSE) {
$blacklisted = TRUE;
}
This code checks if the tag contains the blacklist value, instead of starts with it.
This should be changed to:
if (strpos($tag, $prefix) === 0) {
$blacklisted = TRUE;
}
Comments
Comment #2
rp7 commentedComment #3
jnicola commentedA quick note on this issue, it does indeed not match on prefix... and that's been good for us.
I would think the larger solution here would be to keep the current functionality as a blanket string match, and add a prefix section.
Comment #4
rgristroph commentedIn particular, Drupal 11 now does node:nid:revisions cache tags, and if you want to block ":revisions", that's not a prefix. If your site doesn't show any but the default published revision to the general public, you might get some efficiency from that.