diff --git a/core/modules/serialization/src/Normalizer/PrimitiveDataNormalizer.php b/core/modules/serialization/src/Normalizer/PrimitiveDataNormalizer.php
index cce108cacf..4aede26495 100644
--- a/core/modules/serialization/src/Normalizer/PrimitiveDataNormalizer.php
+++ b/core/modules/serialization/src/Normalizer/PrimitiveDataNormalizer.php
@@ -20,6 +20,7 @@ class PrimitiveDataNormalizer extends NormalizerBase {
    * {@inheritdoc}
    */
   public function normalize($object, $format = NULL, array $context = []) {
+    $this->addCacheableDependency($context, $object);
     // Typed data casts NULL objects to their empty variants, so for example
     // the empty string ('') for string type data, or 0 for integer typed data.
     // In a better world with typed data implementing algebraic data types,
diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestComputedField.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestComputedField.php
index 187effe504..26361de613 100644
--- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestComputedField.php
+++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestComputedField.php
@@ -4,7 +4,9 @@
 
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Field\BaseFieldDefinition;
+use Drupal\Core\StringTranslation\TranslatableMarkup;
 use Drupal\entity_test\Plugin\Field\ComputedReferenceTestFieldItemList;
+use Drupal\entity_test\Plugin\Field\ComputedTestCacheableStringItemList;
 use Drupal\entity_test\Plugin\Field\ComputedTestFieldItemList;
 
 /**
@@ -46,6 +48,13 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ->setSetting('target_type', 'entity_test')
       ->setClass(ComputedReferenceTestFieldItemList::class);
 
+    $fields['computed_test_cacheable_string_field'] = BaseFieldDefinition::create('computed_test_cacheable_string_item')
+      ->setLabel(new TranslatableMarkup('Computed Cacheable String Field Test'))
+      ->setComputed(TRUE)
+      ->setClass(ComputedTestCacheableStringItemList::class)
+      ->setReadOnly(FALSE)
+      ->setInternal(FALSE);
+
     return $fields;
   }
 
diff --git a/core/modules/system/tests/modules/entity_test/src/Plugin/DataType/ComputedTestCacheableString.php b/core/modules/system/tests/modules/entity_test/src/Plugin/DataType/ComputedTestCacheableString.php
new file mode 100644
index 0000000000..c6c88cc4d7
--- /dev/null
+++ b/core/modules/system/tests/modules/entity_test/src/Plugin/DataType/ComputedTestCacheableString.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace Drupal\entity_test\Plugin\DataType;
+
+use Drupal\Core\Cache\RefinableCacheableDependencyInterface;
+use Drupal\Core\Cache\RefinableCacheableDependencyTrait;
+use Drupal\Core\TypedData\Plugin\DataType\StringData;
+
+/**
+ * The string data type with cacheablity metadata.
+ *
+ * The plain value of a string is a regular PHP string. For setting the value
+ * any PHP variable that casts to a string may be passed.
+ *
+ * @DataType(
+ *   id = "computed_test_cacheable_string",
+ *   label = @Translation("Computed Test Cacheable String")
+ * )
+ */
+class ComputedTestCacheableString extends StringData implements RefinableCacheableDependencyInterface {
+
+  use RefinableCacheableDependencyTrait;
+
+}
diff --git a/core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedTestCacheableStringItemList.php b/core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedTestCacheableStringItemList.php
new file mode 100644
index 0000000000..21aaa9f7b0
--- /dev/null
+++ b/core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedTestCacheableStringItemList.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace Drupal\entity_test\Plugin\Field;
+
+use Drupal\Core\Cache\CacheableMetadata;
+use Drupal\Core\Field\FieldItemList;
+use Drupal\Core\TypedData\ComputedItemListTrait;
+
+/**
+ * Item list class for computed cacheable string field.
+ */
+class ComputedTestCacheableStringItemList extends FieldItemList {
+
+  use ComputedItemListTrait;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function computeValue() {
+    /** @var \Drupal\entity_test\Plugin\Field\FieldType\ComputedTestCacheableStringItem $item */
+    $item = $this->createItem(0, 'computed test cacheable string field');
+    $cacheability = (new CacheableMetadata())
+      ->setCacheContexts(['url.query_args:computed_test_cacheable_string_field'])
+      ->setCacheTags(['field:computed_test_cacheable_string_field'])
+      ->setCacheMaxAge(800);
+    $item->get('value')->addCacheableDependency($cacheability);
+    $this->list[0] = $item;
+  }
+
+}
diff --git a/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ComputedTestCacheableStringItem.php b/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ComputedTestCacheableStringItem.php
new file mode 100644
index 0000000000..233606aafd
--- /dev/null
+++ b/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ComputedTestCacheableStringItem.php
@@ -0,0 +1,37 @@
+<?php
+
+namespace Drupal\entity_test\Plugin\Field\FieldType;
+
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Field\Plugin\Field\FieldType\StringItem;
+use Drupal\Core\StringTranslation\TranslatableMarkup;
+use Drupal\Core\TypedData\DataDefinition;
+
+/**
+ * Defines the 'string' entity field type with cacheablity metadata.
+ *
+ * @FieldType(
+ *   id = "computed_test_cacheable_string_item",
+ *   label = @Translation("Test Text (plain with cacheablity)"),
+ *   description = @Translation("A test field containing a plain string value and cacheablity metadata."),
+ *   category = @Translation("Text"),
+ *   no_ui = TRUE,
+ *   default_widget = "string_textfield",
+ *   default_formatter = "string"
+ * )
+ */
+class ComputedTestCacheableStringItem extends StringItem {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
+    $properties['value'] = DataDefinition::create('computed_test_cacheable_string')
+      ->setLabel(new TranslatableMarkup('Text value'))
+      ->setSetting('case_sensitive', $field_definition->getSetting('case_sensitive'))
+      ->setRequired(TRUE);
+
+    return $properties;
+  }
+
+}
diff --git a/core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestResourceTestBase.php b/core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestResourceTestBase.php
index 2210f97d6f..d64e2046e4 100644
--- a/core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestResourceTestBase.php
+++ b/core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestResourceTestBase.php
@@ -2,7 +2,6 @@
 
 namespace Drupal\Tests\entity_test\Functional\Rest;
 
-use Drupal\entity_test\Entity\EntityTest;
 use Drupal\Tests\rest\Functional\BcTimestampNormalizerUnixTestTrait;
 use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
 use Drupal\Tests\Traits\ExpectDeprecationTrait;
@@ -60,9 +59,10 @@ protected function createEntity() {
     $this->container->get('state')->set('entity_test.internal_field', TRUE);
     \Drupal::entityDefinitionUpdateManager()->applyUpdates();
 
-    $entity_test = EntityTest::create([
+    $entity_test = $this->container->get('entity_type.manager')
+    ->getStorage(static::$entityTypeId) ->create([
       'name' => 'Llama',
-      'type' => 'entity_test',
+      'type' => static::$entityTypeId,
       // Set a value for the internal field to confirm that it will not be
       // returned in normalization.
       // @see entity_test_entity_base_field_info().
@@ -99,7 +99,7 @@ protected function getExpectedNormalizedEntity() {
       ],
       'type' => [
         [
-          'value' => 'entity_test',
+          'value' => static::$entityTypeId,
         ],
       ],
       'name' => [
@@ -131,7 +131,7 @@ protected function getNormalizedPostEntity() {
     return [
       'type' => [
         [
-          'value' => 'entity_test',
+          'value' => static::$entityTypeId,
         ],
       ],
       'name' => [
