Hacker News new | past | comments | ask | show | jobs | submit login

>TL;DR: YouTube Embeds are like 1.3MB in size with no shared resources between multiple embeds. Using a <lite-youtube> Web Component is more like 100k, does share resources, and sacrifices no functionality.

I would even go further and wonder why lite-youtube still requires 100K? And why they are not shared across different sites.




In a nutshell: You can track load time of your site. If (e.g.) NBC homepage has videos of X, Y, and Z on their homepage, you can simply embed those same videos on your site.

Does your page take <0.1s to load? The cache was hit which means the user probably visited NBC recently.

We can’t have nice things because people figure out how to use them to track people.


> And why they are not shared across different sites.

Cross site resources caching has been disabled in all major browsers for a few years now, because it was used for tracking.


The lite version still has to download the thumbnail, which is somewhere around 100-150k by itself for the 720p version. YouTube does provide smaller thumbnails you could use instead but with modern screen resolutions you probably want the big one.


Does the 100K figure include thumbnail?

Edit: I guess yes, the unminified JS file here is 10KB and much of it is code comments https://github.com/paulirish/lite-youtube-embed/blob/master/...


> I would even go further and wonder why lite-youtube still requires 100K?

Just turn off your computer and you’ll be using 0K.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: