Page weight matters

I might be the last person on the planet to have discovered this 10-year-old post from Chris Zacharias about how optimising page weight on YouTube suddenly brought access to vast parts of the world that previously couldn't load the watch page. He recounts how, after putting together a proof of concept reducing the page weight from 1.2 MB to 100 KB, page latency times increased. The reason came down to geography:

"When we plotted the data geographically and compared it to our total numbers broken out by region, there was a disproportionate increase in traffic from places like Southeast Asia, South America, Africa, and even remote regions of Siberia. Further investigation revealed that, in these places, the average page load time under Feather was over TWO MINUTES! This meant that a regular video page, at over a megabyte, was taking more than TWENTY MINUTES to load! This was the penalty incurred before the video stream even had a chance to show the first frame. Correspondingly, entire populations of people simply could not use YouTube because it took too long to see anything. Under Feather, despite it taking over two minutes to get to the first frame of video, watching a video actually became a real possibility. Over the week, word of Feather had spread in these areas and our numbers were completely skewed as a result. Large numbers of people who were previously unable to use YouTube before were suddenly able to."

Unfortunately, it looks like developers over the past decade have let Chris's high standard slip—the first request on the current watch page weighs in at 1.6 MB as of today.

Page weight matters, Chris Zacharias

Web Accessibility

Next

Global variables

It feels like it goes without saying in 2022, but please declare your JavaScript variables properly.

Previous

JS1024

You can do a lot with 1 kilobyte of JavaScript if you're a pro code golfer.