Find, Discuss and Share ideas Forums Web Technology Make your Page with YouTube embedded video load faster

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #361
    ludykraks
    Keymaster

    Yes, we all know how much weight those YouTube embeds can add to your webpage, making your site’s user experience awful.

    What if there is a fix?

    Yes, there is.

    You can now use the native loading-lazy for <iframe>.

    You can use lazy-loading to defer loading offscreen iframes until users scroll near them.

    The loading attribute for <iframe> is available in all lastest Chromium browsers.

    Example:

    <iframe src="https://youtube.com"
           loading="lazy"
           width="800"
           height="500"
    </iframe>

    To learn more about making your embeds efficient on your website, visit this Google best practices page.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Recent Posts