FlyerTalk Forums - View Single Post - Websites that "double load." Why?
View Single Post
Old Oct 14, 2016 | 12:03 pm
  #6  
choster
 
Join Date: Feb 2004
Location: Washington, DC USA
Programs: UA; Amtrak
Posts: 2,002
I think a lot comes down to the limitless impatience of web surfers, especially on mobile. Back in the day, web pages were less dynamic, and a browser would load all the code, figure out how it was going to lay out, and draw it. But studies have shown again and again that people will wait for a website that twitches for five seconds while it loads, whereas they won't wait for a website that is blank for three seconds (actual figures vary by study, but it really is about the first three seconds, especially on mobile devices).

Nowadays, the browser starts drawing the page just as soon as it gets the tiniest scrap of layout information. The website supplies the tiniest scrap of layout information first, then spits out sidebars, forms, and so forth. This results in a lot of redraws and repaints and other adjustments, especially on older devices. Facebook was a big leader in this; Google for "Facebook BigPipe."

Second, also in the interest of increasing perceived speed, they're backloading a lot of scripts. If you look at the source of the AA.com homepage, a huge percentage of it is actually scripts that read and send data to Tealium, Google Analytics, and OpenX, the last of which then loads ads. Sometimes, the scripts directly trigger a refresh of the page, either to submit values or to retrieve them, though that's rather primitive. Even if you're doing it in the background, though, loading third party code could also trigger a redraw depending on its dimensions and so forth.
choster is offline