From 99e0181715c0eae9f9087f69d782e38fd70d1d14 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Mon, 15 Sep 2025 13:37:14 +0200 Subject: [PATCH] Add a note that checking for flash messages defeats HTTP cacheability --- session.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/session.rst b/session.rst index 1426614e3af..8188081eb33 100644 --- a/session.rst +++ b/session.rst @@ -265,6 +265,13 @@ It's common to use ``notice``, ``warning`` and ``error`` as the keys of the different types of flash messages, but you can use any key that fits your needs. +.. tip:: + + Accessing flash messages means that the session must be started, which + in turn will cause Symfony to mark the responses as ``private``. In general, + since flashes shall displayed only once, pages that might display flashes + cannot reasonably be cached in HTTP caches. + Configuration -------------