diff --git a/core/modules/comment/src/CommentViewBuilder.php b/core/modules/comment/src/CommentViewBuilder.php
index cd36bc4..38e021e 100644
--- a/core/modules/comment/src/CommentViewBuilder.php
+++ b/core/modules/comment/src/CommentViewBuilder.php
@@ -8,6 +8,7 @@
 namespace Drupal\comment;
 
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
+use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Access\CsrfTokenGenerator;
 use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
 use Drupal\Core\Entity\EntityInterface;
@@ -67,6 +68,22 @@ public function __construct(EntityTypeInterface $entity_type, EntityManagerInter
   }
 
   /**
+   * {@inheritdoc}
+   */
+  protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langcode) {
+    $build = parent::getBuildDefaults($entity, $view_mode, $langcode);
+
+    // The commented entity is invalidated when another comment is added. If
+    // threading is enabled, make sure the rendered comments are invalidated as
+    // well, to refresh comment positioning/indentation.
+    if ($entity->getCommentedEntity()->getFieldDefinition($entity->getFieldName())->getSetting('default_mode')) {
+      $build['#cache']['tags'] = NestedArray::mergeDeep($build['#cache']['tags'], $entity->getCommentedEntity()->getCacheTag());
+    }
+
+    return $build;
+  }
+
+  /**
    * Overrides Drupal\Core\Entity\EntityViewBuilder::buildComponents().
    *
    * In addition to modifying the content key on entities, this implementation
diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php
index b49d993..b6cf6f5 100644
--- a/core/modules/comment/src/Entity/Comment.php
+++ b/core/modules/comment/src/Entity/Comment.php
@@ -40,6 +40,7 @@
  *   uri_callback = "comment_uri",
  *   fieldable = TRUE,
  *   translatable = TRUE,
+ *   render_cache = FALSE,
  *   entity_keys = {
  *     "id" = "cid",
  *     "bundle" = "comment_type",
diff --git a/core/modules/comment/src/Tests/CommentCacheTagsTest.php b/core/modules/comment/src/Tests/CommentCacheTagsTest.php
index f7bd90e..c15bd29 100644
--- a/core/modules/comment/src/Tests/CommentCacheTagsTest.php
+++ b/core/modules/comment/src/Tests/CommentCacheTagsTest.php
@@ -77,7 +77,12 @@ protected function createEntity() {
    */
   protected function getAdditionalCacheTagsForEntity(EntityInterface $entity) {
     /** @var \Drupal\comment\CommentInterface $entity */
-    return array('filter_format:plain_text', 'user:' . $entity->getOwnerId(), 'user_view:1');
+    return array(
+      'entity_test:1',
+      'filter_format:plain_text',
+      'user:' . $entity->getOwnerId(),
+      'user_view:1',
+    );
   }
 
 }
diff --git a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php
index e5c1c41..af169ff 100644
--- a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php
+++ b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php
@@ -102,7 +102,10 @@ public function testCacheTags() {
     drupal_render($build);
     $expected_cache_tags = array(
       'entity_test_view' => TRUE,
-      'entity_test' => array($commented_entity->id()),
+      // The tags of the commented entity are duplicated in
+      // drupal_merge_cache_tags().
+      // @todo Remove the duplicate in https://www.drupal.org/node/2340123
+      'entity_test' => array($commented_entity->id(), $commented_entity->id()),
       'comment_view' => TRUE,
       'comment' => array(1 => $comment->id()),
       'filter_format' => array(
diff --git a/core/modules/comment/src/Tests/CommentTestBase.php b/core/modules/comment/src/Tests/CommentTestBase.php
index 7a0b506..a072336 100644
--- a/core/modules/comment/src/Tests/CommentTestBase.php
+++ b/core/modules/comment/src/Tests/CommentTestBase.php
@@ -184,11 +184,12 @@ public function postComment($entity, $comment, $subject = '', $contact = NULL, $
    */
   function commentExists(CommentInterface $comment = NULL, $reply = FALSE) {
     if ($comment) {
-      $regex = '/' . ($reply ? '<div class="indented">(.*?)' : '');
+      $regex = '!' . ($reply ? '<div class="indented">(.*?)' : '');
       $regex .= '<a id="comment-' . $comment->id() . '"(.*?)';
       $regex .= $comment->getSubject() . '(.*?)';
       $regex .= $comment->comment_body->value . '(.*?)';
-      $regex .= '/s';
+      $regex .= ($reply ? '</article>\s</div>(.*?)' : '');
+      $regex .= '!s';
 
       return (boolean) preg_match($regex, $this->drupalGetContent());
     }
diff --git a/core/modules/comment/src/Tests/CommentThreadingTest.php b/core/modules/comment/src/Tests/CommentThreadingTest.php
index 476e3c9..6fa1197 100644
--- a/core/modules/comment/src/Tests/CommentThreadingTest.php
+++ b/core/modules/comment/src/Tests/CommentThreadingTest.php
@@ -35,6 +35,7 @@ function testCommentThreading() {
     $this->drupalLogin($this->web_user);
     $subject_text = $this->randomMachineName();
     $comment_text = $this->randomMachineName();
+
     $comment1 = $this->postComment($this->node, $comment_text, $subject_text, TRUE);
     // Confirm that the comment was created and has the correct threading.
     $this->assertTrue($this->commentExists($comment1), 'Comment #1. Comment found.');
@@ -42,74 +43,85 @@ function testCommentThreading() {
     // Confirm that there is no reference to a parent comment.
     $this->assertNoParentLink($comment1->id());
 
-    // Reply to comment #1 creating comment #2.
-    $this->drupalLogin($this->web_user);
+    // Post comment #2 following the comment #1 to test if it correctly jumps
+    // out the indentation in case there is a thread above.
+    $subject_text = $this->randomMachineName();
+    $comment_text = $this->randomMachineName();
+    $this->postComment($this->node, $comment_text, $subject_text, TRUE);
+
+    // Reply to comment #1 creating comment #1_3.
     $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment1->id());
-    $comment2 = $this->postComment(NULL, $this->randomMachineName(), '', TRUE);
+    $comment1_3 = $this->postComment(NULL, $this->randomMachineName(), '', TRUE);
+
     // Confirm that the comment was created and has the correct threading.
-    $this->assertTrue($this->commentExists($comment2, TRUE), 'Comment #2. Reply found.');
-    $this->assertEqual($comment2->getThread(), '01.00/');
+    $this->assertTrue($this->commentExists($comment1_3, TRUE), 'Comment #1_3. Reply found.');
+    $this->assertEqual($comment1_3->getThread(), '01.00/');
     // Confirm that there is a link to the parent comment.
-    $this->assertParentLink($comment2->id(), $comment1->id());
+    $this->assertParentLink($comment1_3->id(), $comment1->id());
+
+
+    // Reply to comment #1_3 creating comment #1_3_4.
+    $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment1_3->id());
+    $comment1_3_4 = $this->postComment(NULL, $this->randomMachineName(), $this->randomMachineName(), TRUE);
 
-    // Reply to comment #2 creating comment #3.
-    $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment2->id());
-    $comment3 = $this->postComment(NULL, $this->randomMachineName(), $this->randomMachineName(), TRUE);
     // Confirm that the comment was created and has the correct threading.
-    $this->assertTrue($this->commentExists($comment3, TRUE), 'Comment #3. Second reply found.');
-    $this->assertEqual($comment3->getThread(), '01.00.00/');
+    $this->assertTrue($this->commentExists($comment1_3_4, TRUE), 'Comment #1_3_4. Second reply found.');
+    $this->assertEqual($comment1_3_4->getThread(), '01.00.00/');
     // Confirm that there is a link to the parent comment.
-    $this->assertParentLink($comment3->id(), $comment2->id());
+    $this->assertParentLink($comment1_3_4->id(), $comment1_3->id());
 
-    // Reply to comment #1 creating comment #4.
-    $this->drupalLogin($this->web_user);
+    // Reply to comment #1 creating comment #1_5.
     $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment1->id());
-    $comment4 = $this->postComment(NULL, $this->randomMachineName(), '', TRUE);
+
+    $comment1_5 = $this->postComment(NULL, $this->randomMachineName(), '', TRUE);
+
     // Confirm that the comment was created and has the correct threading.
-    $this->assertTrue($this->commentExists($comment4), 'Comment #4. Third reply found.');
-    $this->assertEqual($comment4->getThread(), '01.01/');
+    $this->assertTrue($this->commentExists($comment1_5), 'Comment #1_5. Third reply found.');
+    $this->assertEqual($comment1_5->getThread(), '01.01/');
     // Confirm that there is a link to the parent comment.
-    $this->assertParentLink($comment4->id(), $comment1->id());
+    $this->assertParentLink($comment1_5->id(), $comment1->id());
 
-    // Post comment #2 overall comment #5.
+    // Post comment #3 overall comment #5.
     $this->drupalLogin($this->web_user);
     $subject_text = $this->randomMachineName();
     $comment_text = $this->randomMachineName();
+
     $comment5 = $this->postComment($this->node, $comment_text, $subject_text, TRUE);
     // Confirm that the comment was created and has the correct threading.
     $this->assertTrue($this->commentExists($comment5), 'Comment #5. Second comment found.');
-    $this->assertEqual($comment5->getThread(), '02/');
+    $this->assertEqual($comment5->getThread(), '03/');
     // Confirm that there is no link to a parent comment.
     $this->assertNoParentLink($comment5->id());
 
-    // Reply to comment #5 creating comment #6.
-    $this->drupalLogin($this->web_user);
+    // Reply to comment #5 creating comment #5_6.
     $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment5->id());
-    $comment6 = $this->postComment(NULL, $this->randomMachineName(), '', TRUE);
+    $comment5_6 = $this->postComment(NULL, $this->randomMachineName(), '', TRUE);
+
     // Confirm that the comment was created and has the correct threading.
-    $this->assertTrue($this->commentExists($comment6, TRUE), 'Comment #6. Reply found.');
-    $this->assertEqual($comment6->getThread(), '02.00/');
+    $this->assertTrue($this->commentExists($comment5_6, TRUE), 'Comment #6. Reply found.');
+    $this->assertEqual($comment5_6->getThread(), '03.00/');
     // Confirm that there is a link to the parent comment.
-    $this->assertParentLink($comment6->id(), $comment5->id());
+    $this->assertParentLink($comment5_6->id(), $comment5->id());
+
+    // Reply to comment #5_6 creating comment #5_6_7.
+    $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment5_6->id());
+    $comment5_6_7 = $this->postComment(NULL, $this->randomMachineName(), $this->randomMachineName(), TRUE);
 
-    // Reply to comment #6 creating comment #7.
-    $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment6->id());
-    $comment7 = $this->postComment(NULL, $this->randomMachineName(), $this->randomMachineName(), TRUE);
     // Confirm that the comment was created and has the correct threading.
-    $this->assertTrue($this->commentExists($comment7, TRUE), 'Comment #7. Second reply found.');
-    $this->assertEqual($comment7->getThread(), '02.00.00/');
+    $this->assertTrue($this->commentExists($comment5_6_7, TRUE), 'Comment #5_6_7. Second reply found.');
+    $this->assertEqual($comment5_6_7->getThread(), '03.00.00/');
     // Confirm that there is a link to the parent comment.
-    $this->assertParentLink($comment7->id(), $comment6->id());
+    $this->assertParentLink($comment5_6_7->id(), $comment5_6->id());
 
-    // Reply to comment #5 creating comment #8.
-    $this->drupalLogin($this->web_user);
+    // Reply to comment #5 creating comment #5_8.
     $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment5->id());
-    $comment8 = $this->postComment(NULL, $this->randomMachineName(), '', TRUE);
+    $comment5_8 = $this->postComment(NULL, $this->randomMachineName(), '', TRUE);
+
     // Confirm that the comment was created and has the correct threading.
-    $this->assertTrue($this->commentExists($comment8), 'Comment #8. Third reply found.');
-    $this->assertEqual($comment8->getThread(), '02.01/');
+    $this->assertTrue($this->commentExists($comment5_8), 'Comment #5_8. Third reply found.');
+    $this->assertEqual($comment5_8->getThread(), '03.01/');
     // Confirm that there is a link to the parent comment.
-    $this->assertParentLink($comment8->id(), $comment5->id());
+    $this->assertParentLink($comment5_8->id(), $comment5->id());
   }
 
   /**
