diff --git a/core/modules/comment/src/CommentViewBuilder.php b/core/modules/comment/src/CommentViewBuilder.php
index a2521ac..6a1d34c 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;
@@ -68,6 +69,21 @@ public function __construct(EntityTypeInterface $entity_type, EntityManagerInter
   }
 
   /**
+   * {@inheritdoc}
+   */
+  protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langcode) {
+    $build = parent::getBuildDefaults($entity, $view_mode, $langcode);
+
+    // Comments are rendered as part of their commented entity, so whenever the
+    // commented entity (whether that be a change in its path alias or even an
+    // additional comment being posted), ensure that this rendered comment is
+    // invalidated also.
+    $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 de10346..1579c48 100644
--- a/core/modules/comment/src/Entity/Comment.php
+++ b/core/modules/comment/src/Entity/Comment.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Entity;
 
+use Drupal\Component\Utility\NestedArray;
 use Drupal\Component\Utility\Number;
 use Drupal\Core\Entity\ContentEntityBase;
 use Drupal\comment\CommentInterface;
@@ -38,6 +39,7 @@
  *   uri_callback = "comment_uri",
  *   fieldable = TRUE,
  *   translatable = TRUE,
+ *   render_cache = FALSE,
  *   entity_keys = {
  *     "id" = "cid",
  *     "bundle" = "field_id",
diff --git a/core/modules/comment/src/Tests/CommentCacheTagsTest.php b/core/modules/comment/src/Tests/CommentCacheTagsTest.php
index d12c6bb..be6b4af 100644
--- a/core/modules/comment/src/Tests/CommentCacheTagsTest.php
+++ b/core/modules/comment/src/Tests/CommentCacheTagsTest.php
@@ -81,7 +81,7 @@ protected function createEntity() {
    * Each comment must have a comment body, which always has a text format.
    */
   protected function getAdditionalCacheTagsForEntity(EntityInterface $entity) {
-    return array('filter_format:plain_text');
+    return array('entity_test:1', 'filter_format:plain_text');
   }
 
 }
diff --git a/core/modules/comment/src/Tests/CommentTestBase.php b/core/modules/comment/src/Tests/CommentTestBase.php
index 48e296b..11fd7b9 100644
--- a/core/modules/comment/src/Tests/CommentTestBase.php
+++ b/core/modules/comment/src/Tests/CommentTestBase.php
@@ -179,11 +179,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 f69b55f..4020f8b 100644
--- a/core/modules/comment/src/Tests/CommentThreadingTest.php
+++ b/core/modules/comment/src/Tests/CommentThreadingTest.php
@@ -38,7 +38,6 @@ function testCommentThreading() {
     $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'uid' => $this->web_user->id()));
 
     // Post comment #1.
-    $this->drupalLogin($this->web_user);
     $subject_text = $this->randomName();
     $comment_text = $this->randomName();
     $comment1 = $this->postComment($this->node, $comment_text, $subject_text, TRUE);
@@ -48,74 +47,75 @@ 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->randomName();
+    $comment_text = $this->randomName();
+    $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->randomName(), '', TRUE);
+    $comment1_3 = $this->postComment(NULL, $this->randomName(), '', 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 #2 creating comment #3.
-    $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment2->id());
-    $comment3 = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
+    // 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->randomName(), $this->randomName(), 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->randomName(), '', TRUE);
+    $comment1_5 = $this->postComment(NULL, $this->randomName(), '', 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.
-    $this->drupalLogin($this->web_user);
+    // Post comment #3 overall comment #5.
     $subject_text = $this->randomName();
     $comment_text = $this->randomName();
     $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->randomName(), '', TRUE);
+    $comment5_6 = $this->postComment(NULL, $this->randomName(), '', 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 #6 creating comment #7.
-    $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment6->id());
-    $comment7 = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
+    // 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->randomName(), $this->randomName(), 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->randomName(), '', TRUE);
+    $comment5_8 = $this->postComment(NULL, $this->randomName(), '', 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());
   }
 
   /**
