Quoting @effulgentsia in #2428703: Add a 'user.permissions' cache context (was: "Should cache contexts be able to associate a cache tag?"):
How about this to address #74: we embed the hierarchy in the context name / service ID only when that hierarchy is intrinsic to the meaning of the context, not merely an implementation choice.
[…]
In a followup, I think we can add a service tag to convey an implementation-driven parent relationship. For example:
cache_context.pagers: ... tags: - { name: cache.context, parent: cache_context.url.query_args:page } cache_context.route: ... tags: - { name: cache.context, parent: cache_context.url }
And thereby allow CacheContexts::optimizeTokens() to optimize for implementations where pagers are solely determined by a single URL query argument and routing is done exclusively by URL.