Jump to content

Defer parsing of Javascript


pilotguy

Recommended Posts

Can anyone make some suggestions on the best way to achieve this?  I've been looking at my GTMetrix report and I have 3 items to improve, one being "Defer parsing of Javascript."  I've done a bit of searching and applied some code in the global template but it doesn't appear to have made a difference.

Link to comment
Share on other sites

2 hours ago, pilotguy said:

I just confirmed the GTmetrix a moment ago, doing another test since the last one (8 hrs prior) - The score remains 18%

You use some JS from external servers - it tells you test gtmetrix.

defer.png

Try this:

Download these JS and Upload them on your server.
Edit your code template and load these JS from your server.

This will solve your problem Defer parsing.

 

Link to comment
Share on other sites

1 hour ago, pilotguy said:

What templates actually would I be editing?  The block itself for example for the top 3 big offenders up there are YOUTUBE video embeds using iframes in a block.

 
 

I would probably put those in 'includeJS' under global/global in templates.

Have you thought of using a service like Cloudflare? This could have a dramatic effect on your score.

Link to comment
Share on other sites

12 hours ago, pilotguy said:

What templates actually would I be editing?  The block itself for example for the top 3 big offenders up there are YOUTUBE video embeds using iframes in a block.

You have too many errors in the template. Before optimization speed you need to fix these errors. see below

html.png

In addition to these errors on the following number of rows from your source:

1073, 1109, 1143, 1181, 1215, 1249 and 1283

you have redundant closing tag "</a>"

Link to comment
Share on other sites

  • 6 months later...
8 hours ago, Himadri Goswami said:

I didnot get how to do this?

Go the the admin area, click on 'Customization' tab at the left-hand side and then 'Themes'.

Click on the edit button of the theme you want to change, select the 'Custom' tab and change the ' Javascript include location' option to use ' Just before </body> tag' and save.

Your JavaScript should be at the bottom of the page now.

 

Link to comment
Share on other sites

  • 4 weeks later...
On 2/17/2017 at 11:11 PM, TDBF said:

Go the the admin area, click on 'Customization' tab at the left-hand side and then 'Themes'.

Click on the edit button of the theme you want to change, select the 'Custom' tab and change the ' Javascript include location' option to use ' Just before </body> tag' and save.

Your JavaScript should be at the bottom of the page now.

 

after update to latest version seems defer error for parsing of java reappeared

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...