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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, config-getCacheKeys.patch, failed testing.

effulgentsia’s picture

effulgentsia’s picture

Status: Needs work » Needs review
moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Looks like a useful code shuffle to me. This blocks a major Performance issue,

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1e61d83 and pushed to 8.0.x. Thanks!

  • alexpott committed 1e61d83 on 8.0.x
    Issue #2312135 by effulgentsia: Rename and protect ConfigFactory::...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.