-
AuthorPosts
-
August 3, 2015 at 9:31 pm #482420
Any chance that the developer would Implement Deferred Parsing of Javascript? It would improve the load speed of not just my site, but any site built with Enfold.
This is from the GTMetrix report. Basically the theme tries to load and process all the fairly sizable chunk of Javascript in the beginning when you visit a page. The visible parts of the page won’t start to load until all this javascript has been loaded in. If the developer can defer the parsing of the JavaScript until it’s needed, that will speed up the perceived page load speeds.
316.9KiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering.
http://constructionguild.biz/wp-includes/js/jquery/jquery.js?ver=1.11.2 (85.8KiB)
http://constructionguild.biz/wp-content/themes/enfold/js/avia.js?ver=3 (72.9KiB)
http://constructionguild.biz/wp-content/themes/enfold/js/shortcodes.js?ver=3 (70.4KiB)
http://constructionguild.biz/wp-includes/js/mediaelement/mediaelement-and-player.min.js?ver=2.16.2 (61.0KiB)
http://constructionguild.biz/wp-content/themes/enfold/js/aviapopup/jquery.magnific-popup.min.js?ver=2 (17.6KiB)
http://constructionguild.biz/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1 (5.5KiB)
http://constructionguild.biz/ (1.8KiB of inline JavaScript)
http://constructionguild.biz/wp-content/themes/enfold/js/avia-compat.js?ver=2 (1.1KiB)
http://constructionguild.biz/wp-includes/js/mediaelement/wp-mediaelement.js?ver=4.2.3 (580B)This could help load time, and be a valuable asset to all of us.
August 5, 2015 at 3:18 pm #483402Hi Joshua!
You can use a plugin such as BWP Minify, https://wordpress.org/plugins/bwp-minify/, to minify the JS. A caching plugin such as WP Supercache or W3T cache is a good way to optimize a WordPress site as well.
Best regards,
ElliottSeptember 19, 2016 at 2:53 pm #688508Hi Elliott, even with W3TC installed, and with js minified, both PageSpeed and YSlow report deferring of javascript as a problem giving a “0” mark. One my sites that uses Enfold has 1.6 MB of JS at load time. I realize that handling plugin js files can be very complex, but is there any statement from the Kriesi team if the developers are working on implementing smart load for Enfold’s native js files?
September 22, 2016 at 5:39 pm #690356Hey!
Try adding this at the very end of your theme / child theme functions.php file:
add_filter('clean_url','async_js',11); function async_js($url) { if ( false !== strpos( $url, 'jquery.js' ) || false === strpos( $url, '.js' )) { return $url; } return "$url' defer='defer"; }
Cheers!
JosueJanuary 31, 2018 at 10:06 pm #905842I tried this and got
htaccess: Invalid command ‘add_filter(‘clean_url’,’async_js’,11);’, perhaps misspelled or defined by a module not included in the server configuration, referer:February 1, 2018 at 3:40 am #905969Hi,
Can you replace this character
‘
manually, sometimes those are causing the issue.
Best regards,
NikkoFebruary 3, 2018 at 1:47 am #907146That’s what was happening. Nice one, please close.
February 3, 2018 at 2:55 pm #907226 -
AuthorPosts
- You must be logged in to reply to this topic.