Keyword

Deferring JavaScript and multiple loading of Javascript ....

  • Nigel Aves
  • Nigel Aves's Avatar Topic Author
  • Offline
  • New Member
More
2 years 4 months ago - 2 years 4 months ago #175294 by Nigel Aves
This is a great plugin that works perfectly for displaying YouTube videos, but a couple of issues have come up while trying to increase my "pagespeed" score. Important now as Google uses these scores during its ranking process.

1/ Is there any way to defer the loading of Javascript? I'm using mod_pagespeed and have the link setup correctly to allow mod_pagespeed to defer and cache the JS from YouTube but this does not seem to work. (Does work on all other sites).

2/ I have two embedded videos on my front page. As you can see below the JS's are being added to the html twice, is there a way to have the JS's only loaded once?

Kind Regards to all, stay safe in these interesting times - Nigel.

Tested using gtmetrix.com/

2.3MiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering.

www.youtube.com/s/player/17480f7d/player_ias.vflset/en_US/base.js (1.0MiB)
www.youtube.com/s/player/17480f7d/player_ias.vflset/en_US/base.js (1.0MiB)
www.youtube.com/yts/jsbin/www-embed-player-vflOkxZXR/www-embed-player.js (99.3KiB)
www.youtube.com/yts/jsbin/www-embed-player-vflOkxZXR/www-embed-player.js (99.3KiB)
Last edit: 2 years 4 months ago by Nigel Aves. Reason: Stop video displaying in page ....

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #175312 by JoomlaWorks
You don't have control over JS that is loaded from the YouTube iframe.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum