Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-5959

Youtube (nocookie) adds a lot of data to page load

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Released
    • Icon: Must have Must have
    • 2.50.1
    • None
    • 5
    • Performance
    • Sprint #155
    • venus

      It seems that youtube-nocookie is adding a lot of data transfer to the page load. The player scripts is around 500Kb (compressed, file is 1.6MB uncompressed).

      Perhaps there is a smaller alternative. We can probably also prevent the script from loading until the user interacts with a video.

      Performance Tests

      I found this article describing how to lazy load regular youtube embeds. It could also work for youtube-nocookie, but since this technique requires a user interaction to load anything but the thumbnail, we maybe wouldn't need nocookie anymore. https://dev.to/haggen/lazy-load-embedded-youtube-videos-520g 

      Tasks

      • Try lazy-load the iframe
      • Investigate loading the script on first user interaction

            pvincent Pieter Vincent (Inactive)
            pvincent Pieter Vincent (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: