Hacker News new | past | comments | ask | show | jobs | submit login
Google Lighthouse recommends not embedding YouTube videos directly (chrome.com)
46 points by jsheard 3 months ago | hide | past | favorite | 15 comments



I’ve always wondered why the embeds don’t do this asynchronously themselves, either as a default or with a flag. The amount of resources these embeds automatically consume is egregious. It seems so odd to tell the world to apply a fix for a platform you own.


Part of it tracking to run better ads on YouTube and other Google properties, probably worth it money wise.


They do lazy load by default now, at least.


Some YouTube PM’s promotion is probably dependent on the data they get from all the embeds and lazy-loading them would affect that

So YT have no motivation to address the issue, you see the same thing across all of Google’s other embeds too

While the Chrome team may care about front end performance there’s little evidence the rest of Google do



I’ve done this too https://its.ffg.co.zw/bikeshed/components/lite-yt/

I’d recommend using HasShortcode in the head so the script is only loaded if the post has a shortcode.

Also, use {{/* and */}} to stop Hugo from trying to render a template tag so you can include it in a code snippet.


btw do you know if possible with twitter? i couldn't find anything on that.


thanks. TIL abt HasShortCode.


I wonder how much bandwidth YouTube would save if a sizable amount of sites followed the advice.


I'm sure youtube is totally fine with the bandwidth costs considering their embeddable player is made for tracking and advertisement.



TFA directly recommends this, as well as other good alternatives.


Yup +1 for this, it makes Lighthouse happy


Wow, was a user of Lighthouse 10y ago, never heard of it again after I changed job, now Google owns it!

It was good then.


I think it was always a Google product https://github.com/GoogleChrome/lighthouse/tree/9ff34c320811.... If I remember right it was an evolution of the page speed test site (can't remember exact name) of which Google was also a contributor to.

There's plenty that can be said about Google, but investing in education and testing around web performance was one of their stand out achievements imo.




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

Search: