Hello, I am using Google Developers PageSpeed Insights and I am running the test on one of my pages. and it says that: 346.5KiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering. and gives me this list.
Are your scripts attached to the bottom of the page (just before the closing </body> tag? That seems the best way to defer script loading to me. Not sure if that’s what the issue is, though.
One of our lessons learned was that in spite of the scripts being @ the bottom of the page. The section of the website that is above the fold that requires the javascript will quit rendering until the javascript loads. So best of both worlds, put the scripts at the bottom of the page and add defer as required if pagespeed insights detects it.
This worked for us on customer pagespeed insight improvements.
I got these script tags that is telling me defer, however I have no control over them since they are from outside sources beyond my server. should I just place them at the bottom of my </body>?
Yes, although make sure any other scripts that depend on them are placed below them. For example, you need to call the jQuery library before linking to other scripts that depend on it.
Hm, I suppose so. There are lots of things in there I don’t know about. Seems like a lot of defer scripts in there, though. What are they all for? If you are looking at optimizing page speed load, my guess would be the best thing you could do is get rid of a lot of those scripts altogether. (Partly tonge-in-cheek, as I don’t know what the purpose of all those scripts is.)
Calling in more than one version of jQuery is likely to cause problems eg.
whichever `jquery.min.js’ is referenced last is likely to override functions in the previous one.
Might not be a problem, but it depends on what version other functions are dependent on.
Just a general question I tested big company and design firm websites and they have very low scores on their websites using PageInsights. My question is am I wasting my time on working on this, because it seems nobody else uses it? Maybe it depends on the content being used?