diff --git a/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php b/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php
index 7911daa..4f0306a 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php
@@ -17,6 +17,7 @@
 use Drupal\entity\Entity\EntityDisplay;
 use Drupal\field\FieldInfo;
 use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpFoundation\Request;
 
 /**
  * Render controller for comments.
@@ -45,6 +46,13 @@ class CommentViewBuilder extends EntityViewBuilder implements EntityViewBuilderI
   protected $csrfToken;
 
   /**
+   * The request object.
+   *
+   * @var \Symfony\Component\HttpFoundation\Request
+   */
+  protected $request;
+
+  /**
    * {@inheritdoc}
    */
   public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) {
@@ -54,7 +62,8 @@ public static function createInstance(ContainerInterface $container, $entity_typ
       $container->get('entity.manager'),
       $container->get('field.info'),
       $container->get('module_handler'),
-      $container->get('csrf_token')
+      $container->get('csrf_token'),
+      $container->get('request')
     );
   }
 
@@ -73,12 +82,15 @@ public static function createInstance(ContainerInterface $container, $entity_typ
    *   The module handler service.
    * @param \Drupal\Core\Access\CsrfTokenGenerator $csrf_token
    *   The CSRF token manager service.
+   * @param \Symfony\Component\HttpFoundation\Request $request
+   *   The request object.
    */
-  public function __construct($entity_type, array $entity_info, EntityManagerInterface $entity_manager, FieldInfo $field_info, ModuleHandlerInterface $module_handler, CsrfTokenGenerator $csrf_token) {
+  public function __construct($entity_type, array $entity_info, EntityManagerInterface $entity_manager, FieldInfo $field_info, ModuleHandlerInterface $module_handler, CsrfTokenGenerator $csrf_token, Request $request) {
     parent::__construct($entity_type, $entity_info, $entity_manager);
     $this->fieldInfo = $field_info;
     $this->moduleHandler = $module_handler;
     $this->csrfToken = $csrf_token;
+    $this->request = $request;
   }
 
   /**
@@ -150,6 +162,20 @@ public function buildContent(array $entities, array $displays, $view_mode, $lang
   }
 
   /**
+   * {@inheritdoc}
+   */
+  protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langcode) {
+    $defaults = parent::getBuildDefaults($entity, $view_mode, $langcode);
+
+    // Add the page number to the cache key if render caching is enabled.
+    if (isset($defaults['#cache']) && $this->request->query->has('page')) {
+      $defaults['#cache']['keys'][] = $this->request->query->get('page');
+    }
+
+    return $defaults;
+  }
+
+  /**
    * #post_render_cache callback; replaces the placeholder with comment links.
    *
    * Renders the links on a comment.
