- This topic has 14 replies, 4 voices, and was last updated 6 years, 3 months ago by
Tom.
-
AuthorPosts
-
June 16, 2016 at 2:49 am #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
DaveJune 16, 2016 at 10:17 am #202494Tom
Lead DeveloperLead DeveloperI’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 π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJune 17, 2016 at 2:41 am #202699Dave
Great// can’t wait to read that!
August 10, 2016 at 2:56 pm #217258Suzanne
Any news on the performance article?
August 10, 2016 at 2:57 pm #217259Tom
Lead DeveloperLead DeveloperAh yes, here it is: https://generatepress.com/fastest-wordpress-theme
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 6, 2016 at 8:09 pm #233044Bin
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!
October 6, 2016 at 11:00 pm #233064Tom
Lead DeveloperLead DeveloperAll 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 π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 7, 2016 at 6:58 am #233175Bin
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
October 7, 2016 at 8:52 am #233213Tom
Lead DeveloperLead DeveloperYou shouldn’t have to put files anywhere – they should be there by default.
Defer should work just fine for those two files π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 7, 2016 at 9:31 am #233239Bin
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
October 7, 2016 at 9:33 am #233244Tom
Lead DeveloperLead DeveloperTo 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 π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 7, 2016 at 9:35 am #233245Bin
Sorry, and what about:
wp-includes/js/wp-embed.min.js?ver=4.6.1
Header or footer?
October 7, 2016 at 9:42 am #233258Tom
Lead DeveloperLead DeveloperProbably footer – that’s another core WP file.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 8, 2016 at 6:59 am #233505Bin
TOM, you are the best!
Bin
October 8, 2016 at 8:09 am #233511Tom
Lead DeveloperLead DeveloperGlad I could help! π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.