CacheableMetadata is misnamed

Created on 2 September 2015, over 9 years ago
Updated 21 August 2023, over 1 year ago

Problem/Motivation

From #2551907: Follow-up for #2483183: make the Breadcrumb value object use composition instead of inheritance :

@yched :

CacheableMetadata trips me up each time as implying that it is "metadata that you can cache". Rather, it's the metadata describing the "cacheability of something" --> CacheabilityMetadata would be more accurate ?

@Wim Leers :

Dear god thank you yes!!!!!!!
I discussed this with catch almost 2 months ago and he agreed we should rename CacheableMetadata to Cacheability. I fear it's too late now though :(

@yched :

Yeah :-/ Given the importance render cache has in D8 (currently and even more after SmartCache), and the fact that it's ... complex enough ;-) (see the discussions in #2556889: [policy, no patch] Decide if SmartCache is still in scope for 8.0 and whether remaining risks require additional mitigation ), I'd think not having misleading names add to the complexity is worth the disruption. I'll create the issue and ask for release manager feedback.

In short :
The render cache and "things providing the right cacheability information" is shaping up to be one of the critical concepts to grasp in D8. Yet our central class for that, "metadata about the cacheability of something", has a name that gives you the wrong idea about what it is. That doesn't really help building and keeping a good mental model, since you have to mentally translate whenever you read / write code dealing with those :-)

Proposed resolution

Rename CacheableMetadata to
- CacheabilityMetadata
- just Cacheability ?

That is late for a BC breaking API change, obviously. Not sure whether how large the potentially impacted code might be though.

Alternatively, we could keep a legacy/deprecated "CacheableMetadata extends [NewBetterName]" around for BC, and move our onternal code to the more accurate [NewBetterName] ?

Remaining tasks

Release manager feedback needed

Beta phase evaluation

<!--Uncomment the relevant rows for the issue. -->
📌 Task
Status

Needs work

Version

11.0 🔥

Component
Cache 

Last updated 3 days ago

Created by

🇫🇷France yched

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024