HTML & CSS · Senior · Question 47 of 75

A gallery with 50 YouTube videos loads very slowly. What should you do first?

Explanation

Each YouTube iframe pulls hundreds of kilobytes of JS and many requests. The facade pattern (e.g. lite-youtube-embed) shows a static thumbnail and swaps in the player only on interaction. loading="lazy" on iframes also helps. autoplay=0 doesn't reduce the embed's weight.

Further reading

Problem with a question

HTML & CSS · Senior · question 47

Test yourself

Take the HTML & CSS · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz