Change record status: 
Project: 
Introduced in branch: 
8.0.x
Introduced in version: 
8.0.0-BETA13
Description: 

The following interface should be implemented by any class whose business logic implies dealing at runtime with variations of a canonical object:

interface RefinableCacheableDependencyInterface {

  public function addCacheContexts(array $cache_contexts);
  public function addCacheTags(array $cache_tags);
  public function mergeCacheMaxAge($max_age);


}

Typical examples are:

  • Code relying on the current content language to decided which entity translation should be displayed. EntityManager::getTranslationFromContext() now automatically takes care of these cases, that is when no language parameter is explicitly provided.
  • Configuration overrides: in core configuration may vary by interface language, which is a required cache context. However contrib can implement additional overrides, for instance Domain Access or Organic Groups: these will require to specify their additional cache contexts dependencies at runtime.
Impacts: 
Module developers