Reputation: 199
I have tested my site in GTmetrix. I got the "Defer Parsing of JavaScript" youtube video related grade as "F". In my site homepage i have used 4 youtube embed video. Please let me know how to fix the issue.
Upvotes: 0
Views: 1515
Reputation:
You can look at using a plugin such as Async Javascript for this.
For YouTube specifically, you can look at a plugin such as Lazy Load for Videos which will do what Asyc Javascript does but for embedded video.
The reason these are a problem is that scripts & embeds can block the downloading & rendering of the rest of a page, especially when they're slower to load. If we defer them, the browser can download the entire page & render it almost immediately. A short time later, some script will load in the videos normally but in the background. This means that the page's content has loaded much faster and nothing is stopping the page from rendering fully.
Upvotes: 1