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
@@ -1526,6 +1537,7 @@ the example below:
15261537    can use the Symfony save handler without side effects and that the session
15271538    has not been started before Symfony is initialized.
15281539
1540+ .. _`Twig Live Component` : https://symfony.com/bundles/ux-live-component/current/index.html 
15291541.. _`phpredis extension` : https://github.com/phpredis/phpredis 
15301542.. _`DoctrineMongoDBBundle configuration` : https://symfony.com/doc/master/bundles/DoctrineMongoDBBundle/config.html 
15311543.. _`MongoDB shell` : https://docs.mongodb.com/manual/mongo/ 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments