Fixed
Project:
Drupal core
Version:
11.4.x-dev
Component:
cache system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Jul 2026 at 14:30 UTC
Updated:
7 Jul 2026 at 21:17 UTC
Jump to comment: Most recent
The anonymous user can never have different roles, so we don't need to add this cache tag.
Found this looking for something else - it seems to be added a lot by access policies to the static variation cache, so it may mean a bit less cacheablemetadata work hopefully.
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
Comment #2
catchI can only reproduce this being added a lot on Drupal 11.3, not main, so possibly something improved in the meantime.
Having said that, it also won't do any harm.
Comment #3
catchComment #5
kristiaanvandeneyndeAs discussed on Slack, this makes total sense. Depending on the scenario it might not improve things much, but not tagging stuff when you don't need to still beats tagging it for no reason.
Consider this RTBC, but awaiting test results.
Comment #6
berdirMakes sense, I would have gone with the suggestion of a $cacheability variable too personally, but that's just personal preference.
Comment #11
godotislateCommitted and pushedb3351dd to main, f7e2186 to 11.x, and d4fe6da to 11.4.x. Thanks!