4 ms·
> also, YouTube's embedded player is 1.17MB js minified (~411KB gzipped) [1] this is why we simply self-host our mp4s w/ <video> tags. I find that as a user th
by matt_wulfeck 9y ago
> also, YouTube's embedded player is 1.17MB js minified (~411KB gzipped) [1]
this is why we simply self-host our mp4s w/ <video> tags.
I find that as a user this is an often not ideal. For starters I probably have the JS cached. And the videos almost always going to play faster and more smoothly from google CDN versus some homebrew solution.
- currysausage 9y ago> For starters I probably have the JS cached. Caching is not an excuse for giant JS files, they still need to be executed by my browser. > And the videos almost always going to play faster and more smoothly from google CDN versus some homebrew solution. That is indeed usually true.
- leeoniya 9y ago> For starters I probably have the JS cached. this is one of those fallacies that people keep repeating and actually believe as truth. if you look at the headers of the youtube player file i linked, you'll see that anyone who had it cached prior to Wed, 28 Jun 2017 18:12:45 GMT is out of luck as well as myself when i request in > 48 hours. i dunno how often it changes, but it's safe to say "very frequently". date:Wed, 28 Jun 2017 18:23:58 GMT expires:Thu, 06 Jul 2017 18:23:58 GMT last-modified:Wed, 28 Jun 2017 18:12:45 GMT also relevant: https://twitter.com/HenriHelvetica/status/877924754195324928 https://twitter.com/HenriHelvetica/status/877924754195324928
- TeMPOraL 9y agoA good point. RE that tweet, I assume the values there are in milliseconds. I hate it when people don't label their axes.
- matt_wulfeck 9y agoIsn't it cached from any website I visit that uses it though? Almost for sure by the time I land on this particular page I've picked up the JS like some virus.
- skrause 9y ago> And the videos almost always going to play faster and more smoothly from google CDN versus some homebrew solution. Speaking of this, why do all of those annoying autoplaying videos on every major news site always take ages to load? Every YouTube video starts playing instantly, but when I click a link to any news site I literally have to sit there waiting over 5 seconds for the video to start playing so that I can pause it again (because otherwise it will start playing after I've already started to scroll down), even though I have a reasonably fast connection.
- nine_k 9y agoThe homebrew solution can also be a CDN, just not Google's own. Also, this greatly depends on the audience size: 30 users / hour might not need a CDN at all.
- ucaetano 9y agoThe CDN isn't just about volume, it's about location and bandwidth. It doesn't matter how many users you have, if the user is in Uganda and your server is in California, the video will never load immediately. And even then, how would you create a homebrew CDN? Sure, you could buy bandwidth, storage and processing capacity in multiple DC providers around the world and build, deploy and maintain your own solutions, at which point you're essentially becoming a small CDN with significantly higher costs as you don't have the efficiencies of scale and 100's (or 1000's) of multiple customers.
- TeMPOraL 9y ago> The CDN isn't just about volume, it's about location and bandwidth. It doesn't matter how many users you have, if the user is in Uganda and your server is in California, the video will never load immediately. But isn't it true that as long as you can send >1s of video in 1s, it doesn't matter? I.e. latency doesn't matter much in video streaming, and bandwidth doesn't need a CDN for the 30 users / hour case? Also, latency probably doesn't matter for 99% of sites, which are already so bloated with JavaScript and other pointless content that processing time dwarfs the connection delay.
- ucaetano 9y agoIt matters, latency means buffering to start a video, plus rebuffering every time you move to a different point in the video. > Also, latency probably doesn't matter for 99% of sites, which are already so bloated with JavaScript and other pointless content that processing time dwarfs the connection delay. Indeed, but then CDNs also dramatically reduce the cost. It is far cheaper to serve an user in Jakarta from a server in Jakarta than from London. And even cheaper if the server is sitting in the ISP's core network in Jakarta. The Internet as we know today couldn't exist without CDNs.