Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Spin-off from #2303881-13: Config entity static cache doesn't get reset and isn't override aware. See there for details, but basically, we want to allow at an API level for a cache key suffix to be retrieved from the config factory that is independent of any single config name, to allow code external to the factory to maintain its own caches without needing to pass a $name to ConfigFactory::getCacheKey() for each config object separately.
Proposed resolution
- Remove the current getCacheKey($name) and getCacheKeys($name) methods from ConfigFactoryInterface. Those are just for ConfigFactory's internal use, so should be protected methods of it.
- Add a getCacheKeys() (no parameters) method to ConfigFactoryInterface, whose meaning is "the keys of the current state of the factory", not "the keys of a single config object". Choosing this name to match the semantics of CacheableInterface::getCacheKeys() even though ConfigFactoryInterface does not extend CacheableInterface (yet).
- Because of the name duplication above, rename the protected methods to getConfigCacheKey(s)().
Major priority because #2303881: Config entity static cache doesn't get reset and isn't override aware is postponed on this.
Comment | File | Size | Author |
---|---|---|---|
#2 | interdiff.txt | 607 bytes | effulgentsia |
#2 | config-getCacheKeys-2.patch | 6 KB | effulgentsia |
config-getCacheKeys.patch | 5.83 KB | effulgentsia | |
Comments
Comment #2
effulgentsia CreditAttribution: effulgentsia commentedComment #3
effulgentsia CreditAttribution: effulgentsia commentedComment #4
moshe weitzman CreditAttribution: moshe weitzman commentedLooks like a useful code shuffle to me. This blocks a major Performance issue,
Comment #5
alexpottCommitted 1e61d83 and pushed to 8.0.x. Thanks!