[wp-trac] [WordPress Trac] #58773: Lazy Load oEmbed iframes

WordPress Trac noreply at wordpress.org
Mon Jul 10 21:46:32 UTC 2023


#58773: Lazy Load oEmbed iframes
-------------------------------------+-------------------------------------
 Reporter:  adamsilverstein          |       Owner:  adamsilverstein
     Type:  defect (bug)             |      Status:  assigned
 Priority:  normal                   |   Milestone:  6.4
Component:  Embeds                   |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing has-patch  |     Focuses:  performance,
  has-unit-tests                     |  sustainability
-------------------------------------+-------------------------------------

Comment (by adamsilverstein):

 == Steps to reproduce
 * Create a post with **several** pages worth of content, then paste a
 youtube (or other embeddable) link to create the embed block
 * Before applying the patch, view the post
   * note iframe content loads immediately on page load, including all
 resources
   * note YT iframe lacks loading attribute
 * Apply the patch
 * Clear the post cache or create a new poat with the same content (` wp
 embed cache clear POST_ID`)
 * Check the post on the front end again.
   * checking the network panel, note that the YT embed isn't loaded
 ''until you scroll down on the page''.
   * view the page source and note that `loading="lazy"` has been added to
 the YT iframe

 == Help needed
 * It would be good to manually go through all of the WordPress supported
 oEmbed types to make sure they all work correctly with this change applied
 * It would be nice to have some benchmarks here, although we'll see the
 biggest change for actual users in the field.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58773#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list