March 2003
Intermediate to advanced
312 pages
7h 12m
English
In order to enhance the user experience, chunked transfer encoding can be used to allow the Web browser to begin rendering content prior to the entire content being generated and sent. A Web server indicates a chunked response with the following header:
Transfer-Encoding: chunked
A chunked transfer encoding allows a format in which the content implicitly declares the length of pieces of the response within the content. Consider the following example PHP script:
<p>This is an example of a time-delayed list:</p> <ul> <? flush(); sleep(3); echo “<li>List item one</li>”; flush(); sleep(1); echo “<li>List item two</li>”; flush(); sleep(1); echo “<li>List item three</li>”; flush(); sleep(1); echo “<li>List item four</li>”; flush(); ...
Read now
Unlock full access