Deferring JavaScript and multiple loading of Javascript ....

  • Nigel Aves
  • Nigel Aves's Avatar Topic Author
  • Offline
  • New Member
4 months 3 days ago - 4 months 3 days 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

2.3MiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering. (1.0MiB) (1.0MiB) (99.3KiB) (99.3KiB)
Last edit: 4 months 3 days ago by Nigel Aves. Reason: Stop video displaying in page ....

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
4 months 2 days ago #175312 by Fotis
You don't have control over JS that is loaded from the YouTube iframe.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory:

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

Powered by Kunena Forum