Page 1 of 1
Progressive Loading?
Posted: Sun Aug 22, 2004 9:42 pm
by Mr Tech
Normally when a page with loads, the borwser waits from all text to load before showing any...
How do I get it to load mysql results, one at a time, without having to wait for all results to load?
Please let me know if you don't undertsand...
Thanks
Ben
Posted: Sun Aug 22, 2004 10:57 pm
by feyd
if you have apache, you can call [php_man]flush[/php_man]() or turn on the php setting, implicit flush.. Then, setting the outgoing data to not-chunked via a [php_man]header[/php_man]() call. And finally, making sure each result is it's own entity in the page, meaning it's not inside some container like a table/table cell (excluding the body tag, obviously), this will allow the browser to render it with less dependance on anything else downloading first..
Posted: Tue Aug 24, 2004 6:19 pm
by Mr Tech
Thanks feyd!
Do you know where I can get an example of setting the outgoing data to not-chunked via a header()? I'm not familiar with it...
thanks again!
Ben
Posted: Tue Aug 24, 2004 6:27 pm
by feyd
Here's the header sent from
http://devnetwork.net --
Code: Select all
HTTP/1.1 302 Found
Date: Tue, 24 Aug 2004 23:22:45 GMT
Server: Apache/1.3.31 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.8 FrontPage/5.0.2.2634a mod_ssl/2.8.18 OpenSSL/0.9.7a
X-Powered-By: PHP/4.3.8
Location: http://forums.devnetwork.net/
Transfer-Encoding: chunked
Content-Type: text/html
however, upon doing some further review of the setting of "chunked", it's probably what you want, and not what I was thinking it'd be..
There may however, be some settings in your httpd.conf or whatever server you are using that shrinks the size of the buffer it waits to fill before sending a packet.. note: alter the size of the packet down will result in more packets having to be sent.. so be careful..