@@ -2,18 +2,21 @@ Flash Message Subscriber
22========================
33
44When flash messages are rendered into the content of a page, you can't cache
5- the page anymore. This listener reads all flash messages into a cookie, leading
6- to them not being there anymore when rendering the template. This will return
7- the page with a set-cookie header which you of course must make sure to not
8- cache in varnish. By default, varnish will simply not cache the whole response
9- when there is a set-cookie header. (Maybe you could do something more clever -
10- if you do, please provide a VCL example.)
5+ the page anymore. When enabled, this subscriber reads all flash messages into a
6+ cookie, leading to them not being there anymore when rendering the template.
7+ This will return the page with a set-cookie header which you of course must
8+ make sure to not cache in varnish. By default, varnish will simply not cache
9+ the whole response when there is a set-cookie header. (Maybe you could do
10+ something more clever - if you do, please provide a VCL example.)
11+
12+ The flash message subscriber is automatically enabled if you configure any of
13+ the options under ``flash_message ``.
1114
1215.. code-block :: yaml
1316
1417 # app/config.yml
1518 fos_http_cache :
16- flash_message_listener :
19+ flash_message :
1720 name : flashes
1821 path : /
1922 host : null
@@ -42,7 +45,7 @@ show the flash message once. This could look along these lines:
4245
4346 function showFlash ()
4447 {
45- var cookie = getCookie (" flashes" ); // fos_http_cache.flash_message_listener .name
48+ var cookie = getCookie (" flashes" ); // fos_http_cache.flash_message .name
4649
4750 if (! cookie) {
4851 return ;
0 commit comments