[Resolved] defer parsing?

Home Forums Support [Resolved] defer parsing?

Home Forums Support defer parsing?

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #202418
    Dave

    Tom, I’m trying to get the speed of my sites down and according to GTMetrix I need to do defer parsing of javascript. I found this: https://premium.wpmudev.org/forums/topic/how-do-i-defer-parsing-of-javascript-to-iprove-performace

    Is there somewhere I can put the code from the post here into GP to make it work? In the Simple CSS plugin or in the other part (can’t remember but I think the plugin that allows code added before/after posts, pages etc…)

    Thanks
    Dave

    #202494
    Tom
    Lead Developer
    Lead Developer

    I’ve used this plugin quite successfully: https://wordpress.org/plugins/async-javascript/

    I’m actually writing an article on performance in GP and some tips to get higher scores. Will hopefully have it done soon πŸ™‚

    #202699
    Dave

    Great// can’t wait to read that!

    #217258
    Suzanne

    Any news on the performance article?

    #217259
    Tom
    Lead Developer
    Lead Developer
    #233044
    Bin

    Hello, Tom. Your recommendation regarding .js files is “defer parsing”. Would you even recommend to put ALL GP .js files into the footer? And what about the css files, where is the best place for them (header or footer)? I’m using Total Cache (not autoptimize) … Good Night, Bin!

    #233064
    Tom
    Lead Developer
    Lead Developer

    All GP JS files are added to the footer.

    jquery.js is the only file that should appear in the header, this is because it’s required for a lot of plugins that might not list it as a dependent (GP does).

    CSS should be included in the header, as it should load before the structure of the site in order to avoid any flashing of styles.

    Let me know if you need more info πŸ™‚

    #233175
    Bin

    OK. So I put these files into the header

    /wp-includes/js/jquery/jquery.js?ver=1.12.4
    /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1

    and all the rest .js goes to the footer (before /body>), right?

    Shall I use combine only with Default Blocking OR better with DEFER operation?

    Regards, Bin

    #233213
    Tom
    Lead Developer
    Lead Developer

    You shouldn’t have to put files anywhere – they should be there by default.

    Defer should work just fine for those two files πŸ™‚

    #233239
    Bin

    Yes, thats right. But I want to combine these 11 GP .js files in just ONE file by using the minify option of W3 Total Cache. I’m using “Combine only” because they are alrdeady minified (by your great effort!). My question is now, if it’s better to set this comined.js file as ASYNCH, DEFER or BLOCKING? Bin

    #233244
    Tom
    Lead Developer
    Lead Developer

    To be honest, I’m not sure. Give each of them a try and test your site on pingdom to see which gets the best results πŸ™‚

    #233245
    Bin

    Sorry, and what about:

    wp-includes/js/wp-embed.min.js?ver=4.6.1

    Header or footer?

    #233258
    Tom
    Lead Developer
    Lead Developer

    Probably footer – that’s another core WP file.

    #233505
    Bin

    TOM, you are the best!

    Bin

    #233511
    Tom
    Lead Developer
    Lead Developer

    Glad I could help! πŸ™‚

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.