Buffer Bouncing

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
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Buffer Bouncing

Post by Gen-ik »

The new versions of PHPNUKE seem to render a HTML page in bits rather than dumping the whole page to the browser once everything has been done. A good example of this is at http://www.deviantart.com

I have a good idea about how this is done and was hoping to get your thoughts on it.


Each page is built up from a load of different modules which display things like the latest members, news, shout box items, and so on. Obviously the data for these modules is coming from a database.

I think this is working by calling ob_start() before a request to the database is made, echoing the results, and then calling ob_end_flush().... and this continues thoughout the page with each module giving a 'streaming' type effect to the whole thing.

However it works I think it is a good idea as it gives the user something to look at while the page is building itself.


Any ideas or thoughts on this?
Cruzado_Mainfrm
Forum Contributor
Posts: 346
Joined: Sun Jun 15, 2003 11:22 pm
Location: Miami, FL

Post by Cruzado_Mainfrm »

i didn't notice that, i have DSL 128kbps downlading speed
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Ok fair point... but in theory would this work? Currently I don't have a site with enough information on it to test it out.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Buffering isn't always necessary: a simple echo can "stream" content.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Might want to look at flush() also...
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Cheers JAM I think that's what I'm after.
Post Reply