@@ -267,10 +267,14 @@ needs.
267267
268268.. tip ::
269269
270- Accessing flash messages means that the session must be started, which
271- in turn will cause Symfony to mark the responses as ``private ``. In general,
272- since flashes shall displayed only once, pages that might display flashes
273- cannot reasonably be cached in HTTP caches.
270+ Accessing flash messages requires starting the session, which in turn
271+ causes Symfony to mark the response as ``private ``. In general, because
272+ flash messages are meant to be displayed only once, pages that might show
273+ them cannot reasonably be cached by HTTP caches.
274+
275+ As an alternative, you can load flash messages asynchronously through
276+ another HTTP request (for example, using a `Twig Live Component `_), making
277+ the original page fully cacheable.
274278
275279Configuration
276280-------------
@@ -1879,6 +1883,7 @@ the example below:
18791883 can use the Symfony save handler without side effects and that the session
18801884 has not been started before Symfony is initialized.
18811885
1886+ .. _`Twig Live Component` : https://symfony.com/bundles/ux-live-component/current/index.html
18821887.. _`phpredis extension` : https://github.com/phpredis/phpredis
18831888.. _`DoctrineMongoDBBundle configuration` : https://symfony.com/doc/master/bundles/DoctrineMongoDBBundle/config.html
18841889.. _`MongoDB shell` : https://docs.mongodb.com/manual/mongo/
0 commit comments