diff --git a/core/lib/Drupal/Core/Messenger/Messenger.php b/core/lib/Drupal/Core/Messenger/Messenger.php index e0707304ad..f94ace9903 100644 --- a/core/lib/Drupal/Core/Messenger/Messenger.php +++ b/core/lib/Drupal/Core/Messenger/Messenger.php @@ -43,6 +43,10 @@ public function addMessage($message, $type = self::TYPE_STATUS, $repeat = FALSE) if ($repeat || !in_array($message, $this->flashBag->peek($type))) { $this->flashBag->add($type, $message); } + + // Mark this page as being uncacheable. + \Drupal::service('page_cache_kill_switch')->trigger(); + return $this; }