A page is sent in one piece, once all of it is rendered. {flush} sends what is
rendered so far straight away: put after the wrapper's </head>, it lets
the browser fetch the stylesheets and fonts while a slow part of the page is still being
rendered.
|
PHP |
HTML fragments/flush_1.pad |
Result |
|---|---|---|
|
The top of the page, sent at once. The rest, sent when it is rendered. |
Shown here inside another page, the fragment flushes nothing - only the page that is the response does. Asked for on its own, it sends its first line before the second is rendered; either way the page arrives whole.
Content-Length, the page cache. The
headers go out with the first part.