Progressive Loading?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

Progressive Loading?

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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..
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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..
Post Reply