Forum paging

This isn’t really a PHP question. Except that’s what I code in now.

On a typical discussion forum (phpBB, phorum or any one of a hundred others) let’s say there is a long discussion thread going with 20 or more comments to the original post, and where each such comment includes one or more photos, perhaps 700 pixels wide. That’s a lot of bandwidth.

I just emptied my Firefox cache and looked at just such a thread. And yet it loaded quickly. If I scroll all the way down to the bottom of the thread (which appears as if it were one loooooooong HTML page) there are close to 40 big photos on display. However, because these are big images the browser display can only show one or two such images at a time.

So I’m assuming (am I right?) the browser only downloads the images one or two at a time, as the viewport requires. How does that work? Does this require something special done in the server-side PHP? Browser-side Ajax (I doubt that…many of these forums preceded Ajax)?

Or does the browser download ALL of the HTML, all at once, but then makes secondary GETs one or two at a time, in order to display images? And if so, how does the browser know which images are currently scrolled to the browser’s viewport?

What am I missing?

Don’t take my answer as definite but as I understand it, a web page is made up of a collection of resources starting with the HTML, and none to many CSS pages, none to many javascripts, none to many images, videos, etc., etc., etc. The html would load first followed by the stuff in the head section and then in the body section. As far as I know browsers establish four connections at one time but this setting can be changed. I don’t think the viewport has anything to do with the loading sequence used by html but a javascript could over ride it.

When you see a web page jump around a lot (annoying as hell) it is because the images don’t have width and height attributes so html reserves a standard width and height which is later changed to match the image’s width and height causing the whole page to redraw. There should be a special
:smashy:
punishment for
:smashy:
designers and
:smashy:
coders who create these unsteady pages.

There used to be a website that showed how a web page loads, showing the time for each resource but I can’t find it now. :frowning: