Defer parsing Javascript warning
-
Hello,
When doing a speed test on GTMetrix, I get a high priority warning on Javascript parsing and it shows a list of cache minify JS. How do I clean up this list and get rid of the warning? Many thanks!
1.0MiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering.
https://www.savvygarments.com/wp-content/cache/minify/0c7e7.js (607.2KiB) https://www.savvygarments.com/wp-content/cache/minify/1544c.js (200.3KiB) https://www.savvygarments.com/wp-content/cache/minify/cfb30.js (92.2KiB) https://www.savvygarments.com/wp-content/cache/minify/729f7.js (58.9KiB) https://www.savvygarments.com/wp-content/cache/minify/ae3d7.js (20.4KiB) https://www.savvygarments.com/wp-content/cache/minify/5c68f.js (18.3KiB) https://www.savvygarments.com/wp-content/cache/minify/e5138.js (16.6KiB) https://www.savvygarments.com/ (13.7KiB of inline JavaScript) https://www.savvygarments.com/wp-content/cache/minify/f1271.js (10.7KiB) https://www.savvygarments.com/wp-content/cache/minify/23e8e.js (9.9KiB) https://www.savvygarments.com/wp-content/cache/minify/fc9b6.js (2.2KiB) https://www.savvygarments.com/wp-content/cache/minify/63a69.js (873B) https://www.savvygarments.com/wp-content/cache/minify/e1364.js (276B)The page I need help with: [log in to see the link]
-
Hello @randydenimes
Thank you for your inquiry and I am happy to help. I believe that this also happens with your scripts even when minify is not enabled. This happens because some theme or plugin script was added incorrectly. It has to be included after jquery originally, but it still works when loaded sync.
What you can do is to go to Performnace>Minify and try tweaking the Before </head>
After <body> in JS minify settings to non-blocking using “defer” and non-blocking using “async”. Potentially it can work but can also break your website and some scripts may stop loading. In that case, simply revert the changes.
If this does not help you can try manual minifying and add JS and CSS files manually and in proper order.
Thank you!Hello @vmarko
Thanks for the reply! I tried that, but it did not get rid of the warning. So if I want to manually try minifying, how do I know which JS and CSS files to minify and which not? On the Wizard, there is a list of all of them. Does it mean I manually select them all? Just worried I don’t know what I’m doing and will cause more damage. Thanks!
Hello @randydenimes
Manual minify can be tricky because you need to know what you are doing.
Wizard shows the JavaScript and CSS files. Initially, you can (not recommended)select all JavaScript files and click Apply to add the file URL to the JS file management section and save the changes. W3 total cache will prompt you to empty the page cache and minify cache. Don’t select script URL’s which are contained “.min.css”, “.min.js” name at the end. Because they are already optimized and adding them may break your website. Clear the cache and view the site. In the case of site misbehavior after the minify, then remove all JS files from the list and try to add them one by one, excluding the problematic files. In certain cases, we may have to drag and drop the files listed in the JS file management section and reorder them if a file depends on another. After the JavaScript, repeat the process for CSS files.
When Minify is in Manual Mode, we also need to set Embed Type. To do that, open Dashboard > Performance > Minify and scroll down to JS section and set the desire to Embed Type E.G. Non-blocking using JS.
I hope this helps!Hello @vmarko
When I manually added all files except the ones which contain min.css or min.js, a much longer list appeared of Javascript parsed. A lot of the files showing have min.js or min.css in it. Seems I’m still a few steps away from having this solved.
1.1MiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering.
https://www.savvygarments.com/wp-content/plugins/revslider/public/assets/js/rs6.min.js?ver=6.1.8 (245.2KiB)
https://www.savvygarments.com/wp-content/themes/overlap/js/plugins.js?ver=1.4.9 (185.3KiB)
https://www.savvygarments.com/wp-content/plugins/wp-charts-and-graphs/assets/js/Chart.min.js?ver=2.3.0 (136.8KiB)
https://www.savvygarments.com/wp-content/plugins/revslider/public/assets/js/revolution.tools.min.js?ver=6.0 (133.0KiB)
https://www.savvygarments.com/wp-includes/js/jquery/jquery.js?ver=1.12.4-wp (86.8KiB)
https://www.savvygarments.com/wp-content/plugins/ninja-tables/public/libs/footable/js/footable.min.js?ver=3.1.5 (71.7KiB)
https://www.savvygarments.com/wp-content/cache/minify/940c8.default.include.4518f6.js (65.8KiB)
https://www.savvygarments.com/wp-content/themes/overlap/js/main.js?ver=1.4.9 (27.7KiB)
https://www.savvygarments.com/wp-content/plugins/wyde-core/shortcodes/js/shortcodes.js?ver=3.8.3 (19.0KiB)
https://www.savvygarments.com/wp-content/plugins/shortpixel-adaptive-images/js/ai.min.js?ver=1.7.5 (18.3KiB)
https://www.savvygarments.com/wp-content/plugins/ninja-tables/assets/js/ninja-tables-footable.3.1.0.js?ver=3.5.10 (18.3KiB)
https://www.savvygarments.com/wp-content/themes/overlap/js/shortcodes.js?ver=1.4.4 (17.0KiB)
https://www.savvygarments.com/wp-content/plugins/wyde-core/assets/js/wyde.js?ver=3.8.3 (14.4KiB)
https://www.savvygarments.com/ (13.6KiB of inline JavaScript)
https://www.savvygarments.com/wp-content/themes/overlap/js/smoothscroll.js?ver=1.4.9 (12.0KiB)
https://www.savvygarments.com/wp-includes/js/jquery/ui/effect.min.js?ver=1.11.4 (11.4KiB)
https://www.savvygarments.com/wp-content/plugins/wp-charts-and-graphs/assets/js/pantherius_wp_charts.js?ver=1.0.6 (11.0KiB)
https://www.savvygarments.com/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=5.1.6 (8.3KiB)
https://www.savvygarments.com/wp-content/plugins/wyde-core/assets/js/modernizr.js (7.9KiB)
https://www.savvygarments.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1 (7.7KiB)
https://www.savvygarments.com/wp-content/plugins/woocommerce/assets/js/jquery-blockui/jquery.blockUI.min.js?ver=2.70 (6.2KiB)
https://www.savvygarments.com/wp-content/plugins/creame-whatsapp-me/public/js/whatsappme.min.js?ver=3.2.0 (3.8KiB)
https://www.savvygarments.com/wp-includes/js/jquery/ui/core.min.js?ver=1.11.4 (3.3KiB)
https://www.savvygarments.com/wp-content/plugins/woocommerce/assets/js/frontend/cart-fragments.min.js?ver=3.8.1 (2.2KiB)
https://www.savvygarments.com/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart.min.js?ver=3.8.1 (2.2KiB)
https://www.savvygarments.com/wp-content/plugins/woocommerce/assets/js/js-cookie/js.cookie.min.js?ver=2.1.4 (1.6KiB)
https://www.savvygarments.com/wp-content/plugins/weglot/dist/front-js.js?ver=3.1.6 (1.4KiB)
https://www.savvygarments.com/wp-content/plugins/yith-infinite-scrolling/assets/js/yith.infinitescroll.min.js?ver=1.1.13 (1.3KiB)
https://www.savvygarments.com/wp-includes/js/wp-embed.min.js?ver=5.3.2 (1.2KiB)
https://www.savvygarments.com/wp-content/plugins/wp-mailto-links/core/includes/assets/js/custom.js?ver=200203-201730 (1014B)
https://www.savvygarments.com/wp-content/plugins/wp-spamshield/js/jscripts-ftr2-min.js (960B)
https://www.savvygarments.com/wp-content/plugins/woocommerce/assets/js/frontend/woocommerce.min.js?ver=3.8.1 (873B)
https://www.savvygarments.com/wp-content/plugins/yith-infinite-scrolling/assets/js/yith-infs.min.js?ver=1.1.13 (429B)
https://www.savvygarments.com/wp-content/plugins/js_composer/assets/js/vendors/woocommerce-add-to-cart.js?ver=6.1 (404B)
https://www.savvygarments.com/wp-content/plugins/wp-charts-and-graphs/assets/js/pantherius_wp_charts_init.js?ver=1.0.6 (276B)
https://www.savvygarments.com/wp-content/plugins/wp-google-maps/wpgmza_data.js?ver=5.3.2 (17B)Hello @randydenimes
As you can see those files are already minified and the original files are causing render-blocking so those files are actually render-blocking and not when minified with W3 Total Cache.
This happens because those scripts were added incorrectly. They have to be included after jquery originally, but it still works when loaded sync.
What you can try is to add those JS files to manual minify, choose your active theme and click on the Add Script button. Copy and paste the JavaScript URLs. In the Operations in areas section, choose the Non-blocking using “defer” embed type for the Before <head> tag.
As I stated before manual minification can be tricky and need to be done with caution. The only other thing I can offer you is our Professional support and for this, you can drop us a note via the plugin in Performance>Support.
Thank you!Hi @vmarko
Thanks for that. I can’t proceed along those steps as I’m not qualified enough. I will contact you via the plug-in support, thanks!
Hi @vmarko
I have another message in GT Metrix with D rating and high priority:
Is that a related problem or is it easier to fix?
Thanks so much!
The following resources are missing a cache validator. Resources that do not specify a cache validator cannot be refreshed efficiently. Specify a Last-Modified or ETag header to enable cache validation for the following resources:
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-content/plugins/creame-whatsapp-me/public/css/whatsappme.min.css?ver=3.2.0
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-content/plugins/js_composer/assets/css/js_composer.min.css?ver=6.1
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-content/plugins/ninja-tables/assets/css/ninjatables-public.css?ver=3.5.10
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-content/plugins/revslider/public/assets/css/rs6.css?ver=6.1.8
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-content/plugins/weglot/dist/css/front-css.css?ver=3.1.6
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/style.css?ver=2.4.5
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-content/plugins/wyde-core/assets/css/font-awesome.min.css?ver=4.6.3
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-content/plugins/wyde-core/shortcodes/css/animation.css?ver=3.8.3
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-content/themes/overlap/css/icons.css?ver=1.4.9
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-content/themes/overlap/css/lightcase.css?ver=1.4.9
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-content/themes/overlap/css/main.css?ver=1.4.9
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-content/themes/overlap/css/shortcodes.css?ver=1.4.4
https://cdn.shortpixel.ai/spai/q_lossy+ret_img+v_2/https://www.savvygarments.com/wp-includes/css/dist/block-library/style.min.css?ver=5.3.2
https://shield.sitelock.com/shield/savvygarments.com
https://www.savvygarments.com/wp-content/plugins/ninja-tables/assets/fonts/ninja-tables.woff?10ed5e333d4d4b43f270e4007cba8413
https://www.savvygarments.com/wp-content/uploads/2017/09/Cambodia-Factory6-300×209.bmpHello @randydenimes
As you can see these are related to https://cdn.shortpixel.ai
There is a possibility of a conflict with the Browser Cache settings in W3 Total Cache and Etag/cache-control settings sent by ShortPixel.
As W3 Total Cache is taking care of Browser Caching, you should change the settings in shorpixel.
Thank you!Hello @vmarko ,
Thank you!
The topic ‘Defer parsing Javascript warning’ is closed to new replies.