'YouTube's own embed code causing Page Speed alerts

We recently ran a series of Google pages peed reports and found that pages using an embedded Youtube player (either within the product imagery or description) have significantly longer load times than all other pages. Now that we're utilizing video on our website more prominently, we'd like to do what we can to reduce these load times.

YouTube is the biggest offender in these categories:

  • Reduce unused Javascript
  • Reduce impact of 3rd party code
  • Some third party resources can be lazy-loaded (to name just a few)

Ironies aside, are there native embed options to improve this? I've tried lightweight players from GitHub, but those introduce visual quirks that are a downgrade from what YouTube's embed provided.

https://github.com/paulirish/lite-youtube-embed



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source