Skip Navigation

[Resolved] Javascript loading twice

This thread is resolved. Here is a description of the problem and solution.

Problem:

So I looked at waterfall view with Youtube videos and it looks like it is parsing javascripts twice. I dont know why.

Solution:

That is Youtube Iframe tag, there isn't anything we can do, and in most browser, if it is same javascript files, it will be loaded from cache of browser.

Relevant Documentation:

This support ticket is created 6 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by martinH-10 6 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#1130022

Hey! I just made another nice website with toolset and astra theme, but it is doing some strange things. At first - site iss soooooooo big because of scripts. It is 2,5MB of scripts?! WTF.

So I looked at waterfall view and it looks like it is parsing javascripts twice. I dont know why. Can you help?

Look at the pingdom :

There’s a ton of more information you can check out here: hidden link

Thank you for a help. Especially youtube scripts are very big. Dont know why they load Two times.

#1130438

Hi,

Where and how do you setup the youtube scripts? if you have setup it in the Views loop item (content template), I suggest you move it to the Views, section "Loop Editor", click panel "JS editor", then it will be loaded once.

More help:
https://toolset.com/documentation/user-guides/adding-custom-javascript-views/

If it is in the youtube iframe, then there isn't anything we can do, and in most browser, if it is same javascript files, it will be loaded from cache of browser.

#1130599
field view.png
layout.png

Hi, I have the youtube videos as custom fields and then in view loop and also in toolset layout. Just normally added youtube.urls. Nothing special.

#1131665

As I mentioned above, since it is a youtube videos field, it will output a HTML iframe tag in front-end, all JS files are setup in the Youtube iframe tag, there isn't anything we can do

And in most web browser, it will be loaded the same JS files from browser cache, so there should not be a performance problem.

#1133408

And do you have any advice how to speed up site using toolset? It seems like page is much faster when I disable the layouts plugin.

#1134020

For the new question:
And do you have any advice how to speed up site using toolset?

It is related with your server capability, you might consider add pagination, display few posts in the each page.

Here are some documents for your reference:
https://toolset.com/faq/working-with-caching-plugins/

You can use other query monitor plugins to locate the problem query.

If you need more assistance for it, please create new ticket for the new question, that will help other users to find the answers.

#1136751

My issue is resolved now. Thank you!