From bc383a3b0386f8543d1ef2db249812134b22dd3f Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 18 Mar 2025 08:01:49 +0000
Subject: [PATCH] Issue #3437499 by catch, kristiaanvandeneynde, oily, berdir:
 Use placeholdering for more blocks

---
 .../Core/Block/BlockPluginInterface.php       | 13 +++++++
 .../Drupal/Core/Block/BlockPluginTrait.php    |  7 ++++
 .../Menu/Plugin/Block/LocalActionsBlock.php   |  7 ++++
 .../Menu/Plugin/Block/LocalTasksBlock.php     |  7 ++++
 core/modules/block/src/BlockViewBuilder.php   |  7 ++++
 .../src/Plugin/Block/BlockContentBlock.php    |  7 ++++
 .../Plugin/Block/SystemBreadcrumbBlock.php    |  7 ++++
 .../src/Plugin/Block/SystemMenuBlock.php      |  7 ++++
 .../views/src/Plugin/Block/ViewsBlock.php     |  4 +++
 .../views/src/Plugin/Block/ViewsBlockBase.php |  7 ++++
 .../AssetAggregationAcrossPagesTest.php       |  8 ++---
 ...nTelemetryAuthenticatedPerformanceTest.php |  5 +--
 .../OpenTelemetryNodePagePerformanceTest.php  | 22 ++++++------
 .../StandardJavascriptTest.php                | 10 +++---
 .../StandardPerformanceTest.php               | 35 ++++++++++---------
 15 files changed, 112 insertions(+), 41 deletions(-)

diff --git a/core/lib/Drupal/Core/Block/BlockPluginInterface.php b/core/lib/Drupal/Core/Block/BlockPluginInterface.php
index e4b330517b4b..ebbef1c6f4c6 100644
--- a/core/lib/Drupal/Core/Block/BlockPluginInterface.php
+++ b/core/lib/Drupal/Core/Block/BlockPluginInterface.php
@@ -76,6 +76,19 @@ public function access(AccountInterface $account, $return_as_object = FALSE);
    */
   public function build();
 
+  /**
+   * Whether to render blocks in a placeholder.
+   *
+   * When blocks of this type are rendered, indicate whether they should be
+   * rendered in a placeholder or not. In general, blocks that attach libraries
+   * and/or render entities should be placeholdered to optimize various aspects
+   * of rendering performance.
+   *
+   * @return bool
+   *   Whether to placeholder blocks of this plugin type.
+   */
+  public function createPlaceholder(): bool;
+
   /**
    * Sets a particular value in the block settings.
    *
diff --git a/core/lib/Drupal/Core/Block/BlockPluginTrait.php b/core/lib/Drupal/Core/Block/BlockPluginTrait.php
index 1701061911a6..8e42db71f046 100644
--- a/core/lib/Drupal/Core/Block/BlockPluginTrait.php
+++ b/core/lib/Drupal/Core/Block/BlockPluginTrait.php
@@ -296,4 +296,11 @@ public function setInPreview(bool $in_preview): void {
     $this->inPreview = $in_preview;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function createPlaceholder(): bool {
+    return FALSE;
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Menu/Plugin/Block/LocalActionsBlock.php b/core/lib/Drupal/Core/Menu/Plugin/Block/LocalActionsBlock.php
index 64ba69275ee5..da696fc8d07c 100644
--- a/core/lib/Drupal/Core/Menu/Plugin/Block/LocalActionsBlock.php
+++ b/core/lib/Drupal/Core/Menu/Plugin/Block/LocalActionsBlock.php
@@ -83,4 +83,11 @@ public function build() {
     return $local_actions;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function createPlaceholder(): bool {
+    return TRUE;
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php b/core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php
index c34d7105e87e..628153831a0f 100644
--- a/core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php
+++ b/core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php
@@ -165,4 +165,11 @@ public function blockSubmit($form, FormStateInterface $form_state) {
     $this->configuration['secondary'] = $levels['secondary'];
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function createPlaceholder(): bool {
+    return TRUE;
+  }
+
 }
diff --git a/core/modules/block/src/BlockViewBuilder.php b/core/modules/block/src/BlockViewBuilder.php
index 1463390fc1ba..f33092de869e 100644
--- a/core/modules/block/src/BlockViewBuilder.php
+++ b/core/modules/block/src/BlockViewBuilder.php
@@ -75,6 +75,13 @@ public function viewMultiple(array $entities = [], $view_mode = 'full', $langcod
         $build[$entity_id] += [
           '#lazy_builder' => [static::class . '::lazyBuilder', [$entity_id, $view_mode, $langcode]],
         ];
+        // Only add create_placeholder if it's explicitly set to TRUE, so it can
+        // be set to TRUE by automatic placeholdering conditions if it's absent.
+        if ($plugin->createPlaceholder()) {
+          $build[$entity_id] += [
+            '#create_placeholder' => TRUE,
+          ];
+        }
       }
     }
 
diff --git a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
index 4a7328e4a35f..c42fb2f5de54 100644
--- a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
+++ b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
@@ -196,6 +196,13 @@ public function build() {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function createPlaceholder(): bool {
+    return TRUE;
+  }
+
   /**
    * Loads the block content entity of the block.
    *
diff --git a/core/modules/system/src/Plugin/Block/SystemBreadcrumbBlock.php b/core/modules/system/src/Plugin/Block/SystemBreadcrumbBlock.php
index 6fcdbafcc18f..a64af2c5f036 100644
--- a/core/modules/system/src/Plugin/Block/SystemBreadcrumbBlock.php
+++ b/core/modules/system/src/Plugin/Block/SystemBreadcrumbBlock.php
@@ -73,4 +73,11 @@ public function build() {
     return $this->breadcrumbManager->build($this->routeMatch)->toRenderable();
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function createPlaceholder(): bool {
+    return TRUE;
+  }
+
 }
diff --git a/core/modules/system/src/Plugin/Block/SystemMenuBlock.php b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php
index 762594f22837..c85af0552342 100644
--- a/core/modules/system/src/Plugin/Block/SystemMenuBlock.php
+++ b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php
@@ -235,4 +235,11 @@ public function getCacheContexts() {
     return Cache::mergeContexts(parent::getCacheContexts(), ['route.menu_active_trails:' . $menu_name]);
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function createPlaceholder(): bool {
+    return TRUE;
+  }
+
 }
diff --git a/core/modules/views/src/Plugin/Block/ViewsBlock.php b/core/modules/views/src/Plugin/Block/ViewsBlock.php
index 20350fa55626..cd9fd62ce1e8 100644
--- a/core/modules/views/src/Plugin/Block/ViewsBlock.php
+++ b/core/modules/views/src/Plugin/Block/ViewsBlock.php
@@ -24,6 +24,10 @@ class ViewsBlock extends ViewsBlockBase {
    * {@inheritdoc}
    */
   public function build() {
+    // If the block plugin is invalid, there is nothing to do.
+    if (!method_exists($this->view->display_handler, 'preBlockBuild')) {
+      return [];
+    }
     $this->view->display_handler->preBlockBuild($this);
 
     $args = [];
diff --git a/core/modules/views/src/Plugin/Block/ViewsBlockBase.php b/core/modules/views/src/Plugin/Block/ViewsBlockBase.php
index bd0d75b62de8..f642617abe06 100644
--- a/core/modules/views/src/Plugin/Block/ViewsBlockBase.php
+++ b/core/modules/views/src/Plugin/Block/ViewsBlockBase.php
@@ -258,4 +258,11 @@ public function getViewExecutable() {
     return $this->view;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function createPlaceholder(): bool {
+    return TRUE;
+  }
+
 }
diff --git a/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php b/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php
index fa7539d89e61..0eeb6a82fb55 100644
--- a/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php
+++ b/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php
@@ -49,10 +49,10 @@ public function testFrontAndRecipesPagesAuthenticated(): void {
     $expected = [
       'ScriptCount' => 3,
       'ScriptBytes' => 170500,
-      'StylesheetCount' => 6,
+      'StylesheetCount' => 5,
+      'StylesheetBytes' => 86650,
     ];
     $this->assertMetrics($expected, $performance_data);
-
   }
 
   /**
@@ -70,8 +70,8 @@ public function testFrontAndRecipesPagesEditor(): void {
     $expected = [
       'ScriptCount' => 5,
       'ScriptBytes' => 338200,
-      'StylesheetCount' => 6,
-      'StylesheetBytes' => 308500,
+      'StylesheetCount' => 5,
+      'StylesheetBytes' => 206750,
     ];
     $this->assertMetrics($expected, $performance_data);
   }
diff --git a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryAuthenticatedPerformanceTest.php b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryAuthenticatedPerformanceTest.php
index fb54a85c23f4..8e9241c75066 100644
--- a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryAuthenticatedPerformanceTest.php
+++ b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryAuthenticatedPerformanceTest.php
@@ -51,18 +51,19 @@ public function testFrontPageAuthenticatedWarmCache(): void {
 
     $expected = [
       'QueryCount' => 4,
-      'CacheGetCount' => 40,
+      'CacheGetCount' => 42,
       'CacheGetCountByBin' => [
         'config' => 22,
         'discovery' => 5,
         'data' => 7,
         'bootstrap' => 4,
         'dynamic_page_cache' => 2,
+        'render' => 2,
       ],
       'CacheSetCount' => 0,
       'CacheDeleteCount' => 0,
       'CacheTagInvalidationCount' => 0,
-      'CacheTagLookupQueryCount' => 2,
+      'CacheTagLookupQueryCount' => 4,
       'ScriptCount' => 2,
       'ScriptBytes' => 123850,
       'StylesheetCount' => 2,
diff --git a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php
index 56b113220203..8718a00e7d4b 100644
--- a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php
+++ b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php
@@ -178,6 +178,9 @@ protected function testNodePageWarmCache(): void {
       'SELECT "base_table"."id" AS "id", "base_table"."path" AS "path", "base_table"."alias" AS "alias", "base_table"."langcode" AS "langcode" FROM "path_alias" "base_table" WHERE ("base_table"."status" = 1) AND ("base_table"."path" LIKE "/node/1" ESCAPE \'\\\\\') AND ("base_table"."langcode" IN ("es", "und")) ORDER BY "base_table"."langcode" ASC, "base_table"."id" DESC',
       'SELECT "menu_tree"."menu_name" AS "menu_name", "menu_tree"."route_name" AS "route_name", "menu_tree"."route_parameters" AS "route_parameters", "menu_tree"."url" AS "url", "menu_tree"."title" AS "title", "menu_tree"."description" AS "description", "menu_tree"."parent" AS "parent", "menu_tree"."weight" AS "weight", "menu_tree"."options" AS "options", "menu_tree"."expanded" AS "expanded", "menu_tree"."enabled" AS "enabled", "menu_tree"."provider" AS "provider", "menu_tree"."metadata" AS "metadata", "menu_tree"."class" AS "class", "menu_tree"."form_class" AS "form_class", "menu_tree"."id" AS "id" FROM "menu_tree" "menu_tree" WHERE ("route_name" = "entity.node.canonical") AND ("route_param_key" = "node=1") AND ("menu_name" = "account") ORDER BY "depth" ASC, "weight" ASC, "id" ASC',
       'SELECT "menu_tree"."menu_name" AS "menu_name", "menu_tree"."route_name" AS "route_name", "menu_tree"."route_parameters" AS "route_parameters", "menu_tree"."url" AS "url", "menu_tree"."title" AS "title", "menu_tree"."description" AS "description", "menu_tree"."parent" AS "parent", "menu_tree"."weight" AS "weight", "menu_tree"."options" AS "options", "menu_tree"."expanded" AS "expanded", "menu_tree"."enabled" AS "enabled", "menu_tree"."provider" AS "provider", "menu_tree"."metadata" AS "metadata", "menu_tree"."class" AS "class", "menu_tree"."form_class" AS "form_class", "menu_tree"."id" AS "id" FROM "menu_tree" "menu_tree" WHERE ("route_name" = "entity.node.canonical") AND ("route_param_key" = "node=1") AND ("menu_name" = "main") ORDER BY "depth" ASC, "weight" ASC, "id" ASC',
+      'SELECT "menu_tree"."menu_name" AS "menu_name", "menu_tree"."route_name" AS "route_name", "menu_tree"."route_parameters" AS "route_parameters", "menu_tree"."url" AS "url", "menu_tree"."title" AS "title", "menu_tree"."description" AS "description", "menu_tree"."parent" AS "parent", "menu_tree"."weight" AS "weight", "menu_tree"."options" AS "options", "menu_tree"."expanded" AS "expanded", "menu_tree"."enabled" AS "enabled", "menu_tree"."provider" AS "provider", "menu_tree"."metadata" AS "metadata", "menu_tree"."class" AS "class", "menu_tree"."form_class" AS "form_class", "menu_tree"."id" AS "id" FROM "menu_tree" "menu_tree" WHERE ("route_name" = "entity.node.canonical") AND ("route_param_key" = "node=1") AND ("menu_name" = "footer") ORDER BY "depth" ASC, "weight" ASC, "id" ASC',
+      'SELECT "base_table"."id" AS "id", "base_table"."path" AS "path", "base_table"."alias" AS "alias", "base_table"."langcode" AS "langcode" FROM "path_alias" "base_table" WHERE ("base_table"."status" = 1) AND ("base_table"."alias" LIKE "/recipes" ESCAPE \'\\\\\') AND ("base_table"."langcode" IN ("en", "und")) ORDER BY "base_table"."langcode" ASC, "base_table"."id" DESC',
+      'SELECT "base_table"."id" AS "id", "base_table"."path" AS "path", "base_table"."alias" AS "alias", "base_table"."langcode" AS "langcode" FROM "path_alias" "base_table" WHERE ("base_table"."status" = 1) AND ("base_table"."alias" LIKE "/node" ESCAPE \'\\\\\') AND ("base_table"."langcode" IN ("en", "und")) ORDER BY "base_table"."langcode" ASC, "base_table"."id" DESC',
       'SELECT "base_table"."vid" AS "vid", "base_table"."nid" AS "nid" FROM "node_revision" "base_table" INNER JOIN "node_field_data" "node_field_data" ON "node_field_data"."nid" = "base_table"."nid" INNER JOIN "node_field_revision" "node_field_revision" ON "node_field_revision"."vid" = "base_table"."vid" AND "node_field_revision"."langcode" = "en" WHERE ("node_field_data"."nid" = "1") AND ("node_field_revision"."revision_translation_affected" = 1) GROUP BY "base_table"."vid", "base_table"."nid" ORDER BY "base_table"."vid" DESC LIMIT 1 OFFSET 0',
       'SELECT "revision"."vid" AS "vid", "revision"."langcode" AS "langcode", "revision"."revision_uid" AS "revision_uid", "revision"."revision_timestamp" AS "revision_timestamp", "revision"."revision_log" AS "revision_log", "revision"."revision_default" AS "revision_default", "base"."nid" AS "nid", "base"."type" AS "type", "base"."uuid" AS "uuid", CASE "base"."vid" WHEN "revision"."vid" THEN 1 ELSE 0 END AS "isDefaultRevision" FROM "node" "base" INNER JOIN "node_revision" "revision" ON "revision"."nid" = "base"."nid" AND "revision"."vid" IN (75)',
       'SELECT "revision".* FROM "node_field_revision" "revision" WHERE ("revision"."vid" IN (75)) AND ("revision"."vid" IN ("75")) ORDER BY "revision"."vid" ASC',
@@ -275,9 +278,6 @@ protected function testNodePageWarmCache(): void {
       'SELECT "t".* FROM "node_revision__field_summary" "t" WHERE ("revision_id" IN ("75")) AND ("deleted" = 0) AND ("langcode" IN ("en", "es", "und", "zxx")) ORDER BY "delta" ASC',
       'SELECT "t".* FROM "node_revision__field_tags" "t" WHERE ("revision_id" IN ("75")) AND ("deleted" = 0) AND ("langcode" IN ("en", "es", "und", "zxx")) ORDER BY "delta" ASC',
       'SELECT "t".* FROM "node_revision__layout_builder__layout" "t" WHERE ("revision_id" IN ("75")) AND ("deleted" = 0) AND ("langcode" IN ("en", "es", "und", "zxx")) ORDER BY "delta" ASC',
-      'SELECT "base_table"."id" AS "id", "base_table"."path" AS "path", "base_table"."alias" AS "alias", "base_table"."langcode" AS "langcode" FROM "path_alias" "base_table" WHERE ("base_table"."status" = 1) AND ("base_table"."alias" LIKE "/recipes" ESCAPE \'\\\\\') AND ("base_table"."langcode" IN ("en", "und")) ORDER BY "base_table"."langcode" ASC, "base_table"."id" DESC',
-      'SELECT "base_table"."id" AS "id", "base_table"."path" AS "path", "base_table"."alias" AS "alias", "base_table"."langcode" AS "langcode" FROM "path_alias" "base_table" WHERE ("base_table"."status" = 1) AND ("base_table"."alias" LIKE "/node" ESCAPE \'\\\\\') AND ("base_table"."langcode" IN ("en", "und")) ORDER BY "base_table"."langcode" ASC, "base_table"."id" DESC',
-      'SELECT "menu_tree"."menu_name" AS "menu_name", "menu_tree"."route_name" AS "route_name", "menu_tree"."route_parameters" AS "route_parameters", "menu_tree"."url" AS "url", "menu_tree"."title" AS "title", "menu_tree"."description" AS "description", "menu_tree"."parent" AS "parent", "menu_tree"."weight" AS "weight", "menu_tree"."options" AS "options", "menu_tree"."expanded" AS "expanded", "menu_tree"."enabled" AS "enabled", "menu_tree"."provider" AS "provider", "menu_tree"."metadata" AS "metadata", "menu_tree"."class" AS "class", "menu_tree"."form_class" AS "form_class", "menu_tree"."id" AS "id" FROM "menu_tree" "menu_tree" WHERE ("route_name" = "entity.node.canonical") AND ("route_param_key" = "node=1") AND ("menu_name" = "footer") ORDER BY "depth" ASC, "weight" ASC, "id" ASC',
       'INSERT INTO "semaphore" ("name", "value", "expire") VALUES ("theme_registry:runtime:umami:Drupal\Core\Utility\ThemeRegistry", "LOCK_ID", "EXPIRE")',
       'DELETE FROM "semaphore"  WHERE ("name" = "theme_registry:runtime:umami:Drupal\Core\Utility\ThemeRegistry") AND ("value" = "LOCK_ID")',
       'INSERT INTO "semaphore" ("name", "value", "expire") VALUES ("active-trail:route:entity.node.canonical:route_parameters:a:1:{s:4:"node";s:1:"1";}:Drupal\Core\Cache\CacheCollector", "LOCK_ID", "EXPIRE")',
@@ -288,7 +288,7 @@ protected function testNodePageWarmCache(): void {
 
     $expected = [
       'QueryCount' => 172,
-      'CacheGetCount' => 247,
+      'CacheGetCount' => 253,
       'CacheGetCountByBin' => [
         'page' => 1,
         'config' => 66,
@@ -297,14 +297,14 @@ protected function testNodePageWarmCache(): void {
         'entity' => 18,
         'bootstrap' => 8,
         'dynamic_page_cache' => 2,
-        'render' => 67,
+        'render' => 73,
         'default' => 3,
         'menu' => 2,
       ],
       'CacheSetCount' => 41,
       'CacheDeleteCount' => 0,
       'CacheTagInvalidationCount' => 0,
-      'CacheTagLookupQueryCount' => 28,
+      'CacheTagLookupQueryCount' => 27,
       'CacheTagGroupedLookups' => [
         [
           'entity_types',
@@ -360,12 +360,6 @@ protected function testNodePageWarmCache(): void {
         ['config:block.block.umami_main_menu', 'config:system.menu.main'],
         ['config:block.block.umami_messages'],
         ['config:block.block.umami_help'],
-        [
-          'config:block.block.umami_local_tasks',
-          'config:workflows.workflow.editorial',
-        ],
-        ['config:views.view.recipes'],
-        ['config:block.block.umami_breadcrumbs'],
         [
           'config:block.block.umami_views_block__recipe_collections_block',
           'taxonomy_term:1',
@@ -401,8 +395,10 @@ protected function testNodePageWarmCache(): void {
           'block_content:1',
           'config:block.block.umami_banner_home',
           'config:block.block.umami_banner_recipes',
+          'config:block.block.umami_breadcrumbs',
           'config:block.block.umami_content',
           'config:block.block.umami_languageswitcher',
+          'config:block.block.umami_local_tasks',
           'config:block.block.umami_page_title',
           'config:block.block.umami_views_block__articles_aside_block_1',
           'config:block.block.umami_views_block__promoted_items_block_1',
@@ -410,6 +406,8 @@ protected function testNodePageWarmCache(): void {
           'config:configurable_language_list',
           'http_response',
         ],
+        ['config:views.view.recipes'],
+        ['config:workflows.workflow.editorial'],
         ['config:user.role.anonymous'],
       ],
       'ScriptCount' => 1,
diff --git a/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php b/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php
index 06a27eb787fd..f46d71442c14 100644
--- a/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php
+++ b/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php
@@ -35,15 +35,13 @@ public function testBigPipe(): void {
       ->setPublished();
     $node->save();
 
-    // Front page: one placeholder, for messages.
+    // Front page: Five placeholders.
     $this->drupalGet('');
-    $this->assertBigPipePlaceholderReplacementCount(1);
+    $this->assertBigPipePlaceholderReplacementCount(5);
 
-    // Node page: 2 placeholders:
-    // 1. messages
-    // 2. comment form
+    // Node page: Six placeholders:
     $this->drupalGet($node->toUrl());
-    $this->assertBigPipePlaceholderReplacementCount(2);
+    $this->assertBigPipePlaceholderReplacementCount(6);
   }
 
   /**
diff --git a/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php b/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
index 896a537909b9..036447895e27 100644
--- a/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
+++ b/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
@@ -127,7 +127,7 @@ protected function testAnonymous(): void {
     $this->assertSame($expected_queries, $recorded_queries);
     $expected = [
       'QueryCount' => 36,
-      'CacheGetCount' => 122,
+      'CacheGetCount' => 132,
       'CacheGetCountByBin' => [
         'page' => 1,
         'config' => 21,
@@ -135,7 +135,7 @@ protected function testAnonymous(): void {
         'discovery' => 38,
         'bootstrap' => 8,
         'dynamic_page_cache' => 2,
-        'render' => 35,
+        'render' => 45,
         'default' => 5,
         'entity' => 2,
         'menu' => 2,
@@ -143,7 +143,7 @@ protected function testAnonymous(): void {
       'CacheSetCount' => 45,
       'CacheDeleteCount' => 0,
       'CacheTagInvalidationCount' => 0,
-      'CacheTagLookupQueryCount' => 21,
+      'CacheTagLookupQueryCount' => 17,
       'CacheTagGroupedLookups' => [
         [
           'route_match',
@@ -174,17 +174,17 @@ protected function testAnonymous(): void {
         ['config:block.block.stark_main_menu', 'config:system.menu.main'],
         ['config:block.block.stark_search_form_wide'],
         ['config:block.block.stark_account_menu', 'config:system.menu.account'],
-        ['config:block.block.stark_breadcrumbs'],
-        ['config:block.block.stark_primary_admin_actions'],
         ['config:block.block.stark_messages'],
-        ['config:block.block.stark_primary_local_tasks'],
-        ['config:block.block.stark_secondary_local_tasks'],
         ['config:block.block.stark_help'],
         ['config:block.block.stark_powered'],
         ['config:block.block.stark_syndicate'],
         [
+          'config:block.block.stark_breadcrumbs',
           'config:block.block.stark_content',
           'config:block.block.stark_page_title',
+          'config:block.block.stark_primary_admin_actions',
+          'config:block.block.stark_primary_local_tasks',
+          'config:block.block.stark_secondary_local_tasks',
           'config:block_list',
           'http_response',
         ],
@@ -225,11 +225,11 @@ protected function testAnonymous(): void {
     $this->assertSame($expected_queries, $recorded_queries);
     $expected = [
       'QueryCount' => 10,
-      'CacheGetCount' => 92,
+      'CacheGetCount' => 102,
       'CacheSetCount' => 16,
       'CacheDeleteCount' => 0,
       'CacheTagInvalidationCount' => 0,
-      'CacheTagLookupQueryCount' => 18,
+      'CacheTagLookupQueryCount' => 14,
       'CacheTagGroupedLookups' => [
         [
           'route_match',
@@ -257,17 +257,18 @@ protected function testAnonymous(): void {
         ['config:block.block.stark_main_menu', 'config:system.menu.main'],
         ['config:block.block.stark_search_form_wide'],
         ['config:block.block.stark_account_menu', 'config:system.menu.account'],
-        ['config:block.block.stark_breadcrumbs'],
-        ['config:block.block.stark_primary_admin_actions'],
         ['config:block.block.stark_messages'],
-        ['config:block.block.stark_primary_local_tasks'],
-        ['config:block.block.stark_secondary_local_tasks'],
         ['config:block.block.stark_help'],
         ['config:block.block.stark_powered'],
         ['config:block.block.stark_syndicate'],
+
         [
+          'config:block.block.stark_breadcrumbs',
           'config:block.block.stark_content',
           'config:block.block.stark_page_title',
+          'config:block.block.stark_primary_admin_actions',
+          'config:block.block.stark_primary_local_tasks',
+          'config:block.block.stark_secondary_local_tasks',
           'config:block_list',
           'http_response',
         ],
@@ -305,11 +306,11 @@ protected function testAnonymous(): void {
     $this->assertSame($expected_queries, $recorded_queries);
     $expected = [
       'QueryCount' => 14,
-      'CacheGetCount' => 80,
+      'CacheGetCount' => 87,
       'CacheSetCount' => 17,
       'CacheDeleteCount' => 0,
       'CacheTagInvalidationCount' => 0,
-      'CacheTagLookupQueryCount' => 16,
+      'CacheTagLookupQueryCount' => 13,
       'StylesheetCount' => 1,
       'StylesheetBytes' => 1950,
     ];
@@ -360,7 +361,7 @@ protected function testLogin(): void {
     $this->assertSame($expected_queries, $recorded_queries);
     $expected = [
       'QueryCount' => 17,
-      'CacheGetCount' => 84,
+      'CacheGetCount' => 83,
       'CacheSetCount' => 1,
       'CacheDeleteCount' => 1,
       'CacheTagInvalidationCount' => 0,
@@ -468,7 +469,7 @@ protected function testLoginBlock(): void {
     $this->assertSame($expected_queries, $recorded_queries);
     $expected = [
       'QueryCount' => 18,
-      'CacheGetCount' => 103,
+      'CacheGetCount' => 105,
       'CacheSetCount' => 1,
       'CacheDeleteCount' => 1,
       'CacheTagInvalidationCount' => 0,
-- 
GitLab