zachleat,
@zachleat@zachleat.com avatar

📮 One YouTube Embed weighs almost 1.2 MB

https://www.zachleat.com/web/youtube-embeds/

hexagoncircle,
@hexagoncircle@fosstodon.org avatar

@zachleat May as well call it a "California king embed" at that size, amirite?

zachleat,
@zachleat@zachleat.com avatar

@hexagoncircle hahahahaha

hexagoncircle,
@hexagoncircle@fosstodon.org avatar

@zachleat Coincidentally, I was adding a youtube embed "easter egg" on my 404 page this morning. Your post came at the right time! Now uses lite-youtube for those big savings 🙌 https://ryanmulligan.dev/oopsies

zachleat,
@zachleat@zachleat.com avatar

@hexagoncircle I love your web site Ryan 😍

hexagoncircle,
@hexagoncircle@fosstodon.org avatar

@zachleat Ah, thank you! My site would be nothing without the top shelf excellence that comes with using @eleventy 🏆

slowe,
@slowe@mastodon.me.uk avatar

@zachleat As well as saving 1.1MB, I think you also avoid Google tracking your visitors before they've had a chance to decide if they want to click play or not.

simevidas,
@simevidas@mastodon.social avatar

@slowe @zachleat To be fair, YouTube’s own embed offers such an enhanced-privacy mode.

sarajw,
@sarajw@front-end.social avatar

@zachleat oh good! Now I don't feel wrong about lazily including my talk just as a link instead of an embed into my site 👍

wills,

@zachleat a single embed of google maps with 1 Marker is 978kb (i implemented paul Irish's library for YouTube a few weeks ago) but haven't found a similar tactic for googlemaps just yet (i checked out competitor mapbox-gl, & its 2.5mb)

zachleat,
@zachleat@zachleat.com avatar

@wills the static maps API for a fallback might be your best bet, maybe this could be a web component you create?

https://developers.google.com/maps/documentation/maps-static/overview

nhoizey,
@nhoizey@mamot.fr avatar

@wills @zachleat I use Mapbox on https://nicolas-hoizey.photo/map/ because it’s interactive.

But on individual photo pages, the map is a static image. At @eleventy build time, if the map image is still missing (generating them is another asynchronous process), I use Mapbox static map URLs.

zachleat,
@zachleat@zachleat.com avatar

@nhoizey @wills @eleventy you should… (wait for it)

…blog about this 😅

nhoizey,
@nhoizey@mamot.fr avatar

@zachleat I have a lot to say about this website! 😅

@wills @eleventy

bzdev,
@bzdev@fosstodon.org avatar

@zachleat The idea that one 'youtube embed weighs 1.2 MB' reminds me of something I heard years ago. A government project required developing software going into an airplane. "What does it weight?" "Huh?" "Everything in an airplane has to specify a weight." So, they listed the weight of a floppy disk. This caused a major complaint: "You are way out of line on the price per pound ratio." Finally they explained it as "tooling costs."

zachleat,
@zachleat@zachleat.com avatar

@bzdev 😅 can a therapist somewhere please quantify psychological weight

ernie,
@ernie@writing.exchange avatar

@zachleat This is what always makes me laugh about how aggressive Google has been with core web vitals—it’s literally their external code that is slowing everything down. When I added a script that replaced YouTube embeds with images, that helped my CWVs a lot.

zachleat, (edited )
@zachleat@zachleat.com avatar

@ernie Yeah: Google is basically hundreds of different companies—most of Google’s performance advice can be viewed as though it is aimed directly at other teams at Google. I think in many cases the web performance resources were prepared with that in mind.

Notably, the solution I recommend is a web component written by a Google employee 😅

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • everett
  • osvaldo12
  • magazineikmin
  • thenastyranch
  • rosin
  • normalnudes
  • Youngstown
  • Durango
  • slotface
  • ngwrru68w68
  • kavyap
  • mdbf
  • InstantRegret
  • JUstTest
  • ethstaker
  • GTA5RPClips
  • tacticalgear
  • Leos
  • anitta
  • modclub
  • khanakhh
  • cubers
  • cisconetworking
  • megavids
  • provamag3
  • tester
  • lostlight
  • All magazines