From 09557148f81a4295c75e91f9968bd1882555b7b5 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/session.rst b/session.rst index 1426614e3af..d2eed9e1163 100644 --- a/session.rst +++ b/session.rst @@ -265,6 +265,14 @@ 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 -------------