diff --git a/src/Plugin/ExtraFieldDisplayFormattedBase.php b/src/Plugin/ExtraFieldDisplayFormattedBase.php
index 81b2fad..de89646 100644
--- a/src/Plugin/ExtraFieldDisplayFormattedBase.php
+++ b/src/Plugin/ExtraFieldDisplayFormattedBase.php
@@ -68,6 +68,7 @@ abstract class ExtraFieldDisplayFormattedBase extends ExtraFieldDisplayBase impl
 
       if ($children = Element::children($elements, TRUE)) {
         $build['#is_multiple'] = TRUE;
+        $build['#cache'] = !empty($elements['#cache']) ? $elements['#cache'] : [];
 
         // Without #children the field will not show up.
         $build['#children'] = '';
diff --git a/tests/extra_field_test/src/Plugin/ExtraField/Display/MultipleItemsFieldWithCacheDependencyTest.php b/tests/extra_field_test/src/Plugin/ExtraField/Display/MultipleItemsFieldWithCacheDependencyTest.php
new file mode 100644
index 0000000..9af646a
--- /dev/null
+++ b/tests/extra_field_test/src/Plugin/ExtraField/Display/MultipleItemsFieldWithCacheDependencyTest.php
@@ -0,0 +1,105 @@
+<?php
+
+namespace Drupal\extra_field_test\Plugin\ExtraField\Display;
+
+use Drupal\Core\Entity\ContentEntityInterface;
+use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
+use Drupal\Core\Render\RendererInterface;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+use Drupal\extra_field\Plugin\ExtraFieldDisplayFormattedBase;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Extra field Display for a field with multiple items output.
+ *
+ * @ExtraFieldDisplay(
+ *   id = "multiple_text_with_cache_dependency_test",
+ *   label = @Translation("Extra field with multiple text item and a cache dependency"),
+ *   bundles = {
+ *     "node.first_node_type",
+ *   },
+ *   visible = true
+ * )
+ */
+class MultipleItemsFieldWithCacheDependencyTest extends ExtraFieldDisplayFormattedBase implements ContainerFactoryPluginInterface {
+
+  use StringTranslationTrait;
+
+  /**
+   * The entity type manager.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
+   */
+  protected $entityTypeManager;
+
+  /**
+   * The render service.
+   *
+   * @var \Drupal\Core\Render\RendererInterface
+   */
+  protected $renderer;
+
+  /**
+   * Constructs a MultipleItemsFieldWithCacheDependencyTest object.
+   *
+   * @param array $configuration
+   *   A configuration array containing information about the plugin instance.
+   * @param string $plugin_id
+   *   The plugin_id for the plugin instance.
+   * @param mixed $plugin_definition
+   *   The plugin implementation definition.
+   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
+   *   The entity type manager.
+   * @param \Drupal\Core\Render\RendererInterface $renderer
+   *   The render service.
+   */
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+    $this->entityTypeManager = $entity_type_manager;
+    $this->renderer = $renderer;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition,
+      $container->get('entity_type.manager'),
+      $container->get('renderer')
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function viewElements(ContentEntityInterface $entity) {
+    $build = [];
+
+    $another_node_type_nodes = $this->entityTypeManager->getStorage('node')->loadByProperties(['type' => 'another_node_type']);
+    foreach ($another_node_type_nodes as $another_node) {
+      $build[] = ['#markup' => $another_node->label()];
+      $this->renderer->addCacheableDependency($build, $another_node);
+    }
+
+    return $build;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getLabel() {
+    return $this->t('Related pages');
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getLabelDisplay() {
+    return 'inline';
+  }
+
+}
diff --git a/tests/src/Functional/ExtraFieldBrowserTestBase.php b/tests/src/Functional/ExtraFieldBrowserTestBase.php
index d50474d..55112a6 100644
--- a/tests/src/Functional/ExtraFieldBrowserTestBase.php
+++ b/tests/src/Functional/ExtraFieldBrowserTestBase.php
@@ -52,7 +52,7 @@ abstract class ExtraFieldBrowserTestBase extends BrowserTestBase {
     /** @var \Drupal\Core\Entity\ContentEntityInterface $node */
     $node = \Drupal::entityTypeManager()->getStorage('node')->create([
       'type' => $contentType,
-      'title' => $this->randomString(),
+      'title' => $this->randomMachineName(),
     ]);
     $node->save();
 
diff --git a/tests/src/Functional/ExtraFieldDisplayFieldTest.php b/tests/src/Functional/ExtraFieldDisplayFieldTest.php
index 493ed32..6bea5de 100644
--- a/tests/src/Functional/ExtraFieldDisplayFieldTest.php
+++ b/tests/src/Functional/ExtraFieldDisplayFieldTest.php
@@ -24,6 +24,13 @@ class ExtraFieldDisplayFieldTest extends ExtraFieldBrowserTestBase {
    */
   protected $firstNode;
 
+  /**
+   * A second node.
+   *
+   * @var \Drupal\node\Entity\Node
+   */
+  protected $secondNode;
+
   /**
    * {@inheritdoc}
    */
@@ -31,6 +38,7 @@ class ExtraFieldDisplayFieldTest extends ExtraFieldBrowserTestBase {
     parent::setUp();
 
     $this->firstNode = $this->createContent('first_node_type');
+    $this->secondNode = $this->createContent('another_node_type');
     $this->setupEnableExtraFieldTestModule();
   }
 
@@ -54,6 +62,11 @@ class ExtraFieldDisplayFieldTest extends ExtraFieldBrowserTestBase {
     $this->assertSession()->responseContains('<div class="field__item">Noot</div>');
     $this->assertSession()->responseContains('field--name-extra-field-multiple-text-test');
 
+    // Test the output of field with cacheable dependency.
+    $this->assertSession()->responseContains('<div class="field__label">Related pages</div>');
+    $this->assertSession()->responseContains('<div class="field__item">' . $this->secondNode->label() . '</div>');
+    $this->assertCacheTag('node:' . $this->secondNode->id());
+
     // Test the output of field without content.
     $this->assertSession()->responseNotContains('field--name-extra-field-empty-formatted-test');
   }
