3 ms·
>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 sha
by ksec 2y ago
>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.
- nolok 2y ago> 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.
- jsheard 2y agoThe 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.
- cuu508 2y agoDoes 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/src/lite-yt-embed.js https://github.com/paulirish/lite-youtube-embed/blob/master/...
- KMnO4 2y agoIn 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.
- dangus 2y ago> I would even go further and wonder why lite-youtube still requires 100K? Just turn off your computer and you’ll be using 0K.