05 July 2013

YouTube's Video Pages Will Load Faster



A few weeks ago, a reader noticed an interesting YouTube experiment that displayed a red progress bar when loading video pages. It was obvious that video pages were loaded dynamically using AJAX.



Gizmodo posted an article last week about this experiment. It turns out that YouTube will soon launch this new interface.



"Currently, when you click on a YouTube video, first the watch page loads (the webpage that the video sits on). Then the JavaScript that controls that page is downloaded, then the video player, and then the video itself starts downloading." In the new interface, everything is downloaded simultaneously. When you click a new video, YouTube only loads the new page and then the video. It's no longer necessary to download the video player and the JavaScript/CSS files.






Another change is that YouTube preloads the page and the first part of the video you're likely to watch next before you even click it, so that the video loads almost instantly. This works because the Flash player now uses adaptive streaming and downloads videos in slices. The first slice of the next video you're likely to watch is prefetched. This works well for playlists and search results (YouTube prefetches the first result), but also for video pages, where YouTube shows suggestions.

No comments:

Post a Comment