How to make all render caches update on a configuration override?
In the meantime I have come up with this approach, but I am still open to other solutions.


I have found a solution in a pre_render callback for the blocks, by deconstruction the cacheable metadata, searching it for a system.site tag and append my own context and tags (if required).

/**
 * Implements hook_block_view_alter().
 */
functionmymodule_block_view_alter(array &amp;$build, \Drupal\Core\Block\BlockPluginInterface $block) {
  $build['#pre_render'][] = 'mymodule_block_view_pre_render';
}

/**
 * #pre_render callback: Sets my module cache tags.
 */
function mymodule_block_view_pre_render(array $build) {
  $cacheable_metadata = CacheableMetadata::createFromRenderArray($build);
  $tags = $cacheable_metadata-&gt;getCacheTags();

  if (in_array('config:system.site', $tags)) {
    // Always add a cache context, so we have a variant without overrides as well.
    $cacheable_metadata-&gt;addCacheContexts(['mycontext']);

    if ($entity = MyEntity::Load(1)) {
      $cacheable_metadata-&gt;addCacheableDependency($entity );
    }
  }

  $cacheable_metadata-&gt;applyTo($build);

  return $build;
}