core/lib/Drupal/Core/Render/MainContent/SmartCacheHtmlRenderer.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/lib/Drupal/Core/Render/MainContent/SmartCacheHtmlRenderer.php b/core/lib/Drupal/Core/Render/MainContent/SmartCacheHtmlRenderer.php index 3bee05a..79c727a 100644 --- a/core/lib/Drupal/Core/Render/MainContent/SmartCacheHtmlRenderer.php +++ b/core/lib/Drupal/Core/Render/MainContent/SmartCacheHtmlRenderer.php @@ -132,6 +132,11 @@ protected function finish(array $html) { $html_cache_max_age = Cache::mergeMaxAges($html_cache_max_age, $cacheable_html[$child]['#cache']['max-age']); } + // Retain page titles defined in the main content render array. + if (isset($html['page']['#title'])) { + $cacheable_html['page']['#title'] = $html['page']['#title']; + } + // @todo DEBUG DEBUG DEBUG PROFILING PROFILING PROFILING — Until only the // truly uncacheable things set max-age = 0 (such as the search block and // the breadcrumbs block, which currently set max-age = 0, even though it