core/lib/Drupal/Core/EventSubscriber/SmartCacheSubscriber.php | 7 +++++++ core/lib/Drupal/Core/Render/MainContent/SmartCacheHtmlRenderer.php | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/core/lib/Drupal/Core/EventSubscriber/SmartCacheSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/SmartCacheSubscriber.php index 93dc74e..00d5972 100644 --- a/core/lib/Drupal/Core/EventSubscriber/SmartCacheSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/SmartCacheSubscriber.php @@ -80,6 +80,13 @@ public function onRouteMatch(GetResponseEvent $event) { return; } + // @todo For now, SmartCache doesn't handle admin routes. It may be too much + // work to add the necessary cacheability metadata to all admin routes + // before 8.0.0, but that can happen in 8.1.0 without a BC break. + if ($this->routeMatch->getRouteObject()->getOption('_admin_route')) { + return; + } + $this->routeMatch->getRouteName(); // Get the contexts by which the current route's response must be varied. diff --git a/core/lib/Drupal/Core/Render/MainContent/SmartCacheHtmlRenderer.php b/core/lib/Drupal/Core/Render/MainContent/SmartCacheHtmlRenderer.php index 133499d..26dc5ba 100644 --- a/core/lib/Drupal/Core/Render/MainContent/SmartCacheHtmlRenderer.php +++ b/core/lib/Drupal/Core/Render/MainContent/SmartCacheHtmlRenderer.php @@ -95,6 +95,13 @@ protected function finish(array $html) { return parent::finish($html); } + // @todo For now, SmartCache doesn't handle admin routes. It may be too much + // work to add the necessary cacheability metadata to all admin routes + // before 8.0.0, but that can happen in 8.1.0 without a BC break. + if ($this->routeMatch->getRouteObject()->getOption('_admin_route')) { + return parent::finish($html); + } + $cacheable_html = $html; // Get the contexts by which the current route's response must be varied.