File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,17 @@ It's common to use ``notice``, ``warning`` and ``error`` as the keys of the
265265different types of flash messages, but you can use any key that fits your
266266needs.
267267
268+ .. tip ::
269+
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.
278+
268279Configuration
269280-------------
270281
@@ -1881,6 +1892,7 @@ the example below:
18811892 can use the Symfony save handler without side effects and that the session
18821893 has not been started before Symfony is initialized.
18831894
1895+ .. _`Twig Live Component` : https://symfony.com/bundles/ux-live-component/current/index.html
18841896.. _`phpredis extension` : https://github.com/phpredis/phpredis
18851897.. _`DoctrineMongoDBBundle configuration` : https://symfony.com/doc/master/bundles/DoctrineMongoDBBundle/config.html
18861898.. _`MongoDB shell` : https://docs.mongodb.com/manual/mongo/
You can’t perform that action at this time.
0 commit comments