Magento – Eliminate render-blocking JS and CSS

cssjavascriptmagento-1.9

Really hoping someone can help with this. I've been battling it for hours and seem to be getting nowhere.

Google Page Speed is penalizing us and saying we need to 'Eliminate render-blocking JavaScript and CSS in above-the-fold content'. There is a .js file in question; which I believe to be prototype.cs (my js is compressed so the file names are all weird, but if I open it up I believe it's this). It's also bringing up my fonts https://fonts.googleapis.com/… etc on CSS.

How and where do I fix this? Our mobile page speed is 55/100 with this being the biggest one. I would like to get it higher.

Best Answer

Although, not a direct answer, but,

If you are trying to defer the parsing of prototype.js, I'd strongly suggest against that. This file is responsible for many functions on the page, even for above the fold content, including menu bar and search form. 55/100 score shouldn't be only because of this file. You should focus on improving other things first. Deferring of JS is a general recommendation which doesn't apply to Magento unless you have some extra strong knowledge of prototype and Magento both. It will also require modification of a lot of files in your whole theme.

Related Topic