diff --git a/core/lib/Drupal/Core/Display/VariantInterface.php b/core/lib/Drupal/Core/Display/VariantInterface.php index d1250f9..787f90f 100644 --- a/core/lib/Drupal/Core/Display/VariantInterface.php +++ b/core/lib/Drupal/Core/Display/VariantInterface.php @@ -80,6 +80,10 @@ public function access(AccountInterface $account = NULL); /** * Builds and returns the renderable array for the display variant. * + * The variant can contain cacheability metadata that for the configuration + * that was passed in setConfiguration(). In the build() method, this should + * be added to the render array that is returned. + * * @return array * A render array for the display variant. */ diff --git a/core/lib/Drupal/Core/Render/PageDisplayVariantSelectionEvent.php b/core/lib/Drupal/Core/Render/PageDisplayVariantSelectionEvent.php index 56c6b2e..56c881d 100644 --- a/core/lib/Drupal/Core/Render/PageDisplayVariantSelectionEvent.php +++ b/core/lib/Drupal/Core/Render/PageDisplayVariantSelectionEvent.php @@ -19,6 +19,7 @@ * information along to the selected variant: * - self::setPluginConfiguration() * - self::setContexts() + * - self::addCacheableDependency() * * @see \Drupal\Core\Render\RenderEvents::SELECT_PAGE_DISPLAY_VARIANT * @see \Drupal\Core\Render\MainContent\HtmlRenderer