diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 3c92450c0ed6062f9c97977a9e463c694184f9e3..1491817baf093d6d6107ab983989a41ba196ebe6 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -249,6 +249,9 @@ function comment_field_instance_create(FieldInstanceInterface $instance) {
 function comment_field_instance_update(FieldInstanceInterface $instance) {
   if ($instance->getType() == 'comment') {
     \Drupal::entityManager()->getViewBuilder($instance->entity_type)->resetCache();
+    // Comment field settings also affects the rendering of *comment* entities,
+    // not only the *commented* entities.
+    \Drupal::entityManager()->getViewBuilder('comment')->resetCache();
   }
 }
 
@@ -416,6 +419,23 @@ function comment_new_page_count($num_comments, $new_replies, EntityInterface $en
   return $pagenum;
 }
 
+/**
+ * Implements hook_entity_view_alter().
+ */
+function comment_entity_view_alter(&$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
+  // Add the comment page number to the cache key if render caching is enabled.
+  if (isset($build['#cache']) && isset($build['#cache']['keys']) && \Drupal::request()->query->has('page')) {
+    foreach ($entity->getPropertyDefinitions() as $field_name => $definition) {
+      if (isset($build[$field_name]) && $definition->getType() === 'comment') {
+        $display_options = $display->getComponent($field_name);
+        $pager_id = $display_options['settings']['pager_id'];
+        $page = pager_find_page($pager_id);
+        $build['#cache']['keys'][] = $field_name . '-pager-' . $page;
+      }
+    }
+  }
+}
+
 /**
  * Implements hook_entity_view().
  */