How YouTube's fast through https !

I RIPPED Youtube !!!

·

2 min read

How YouTube's fast through https !

Hola folks !

We are going see how YouTube efficiently streams videos through https (Web-browser).

  • This is kind of looking at backend side of YouTube.

open YouTube in browser > open dev tools ctrl + shift + I >
open Network > then open XMLhttpRequest Fetch/XHR .

  • We are finally ready to start understanding the basics

Understanding Waterfall :

here's what it looks like waterfall.jpg

  • Waterfall is a perception of browser doings as the query is generated like get, async, fetch, await and many more.

interestingly if you want to know if there's a performance problem, like delay in rendering page or DOM event so on. You can just identify with the color-coded Markers.

//visit link.

  1. When you select Fetch/XHR tab in Dev Tools you will find something like videoplayback?expire=...
  2. on opening this tab you will find a sub head named status-code and content-type. That's it we got the nerve !!!

A deep dive :

- So, talking about desktop mode you will find that domains of audio and video stream on different threads simultaneously to leverage the power of protocol for multiplexing.

  • also if you minimize the screen i.e. playing YouTube in the back, it will only request for audio and not for video(since it isn't in use). Just look at the content type, it shows(audio/webn) more frequently than (video/webn).

the direct profit goes to the other side because due to this there's big downfall in bandwidth consumption...

  • Talking about android, they may have designed seperator for audio and video.

THIS HOW MOST OF THE WEBSITES CHANGE THE USER EXPERIENCE A/C TO THE DEVICE THEY USE ..