Google+

Pages

Friday, January 1, 2016

Eliminate render-blocking JavaScript and CSS in above-the-fold content in Magento

To remove render-blocking JavaScript issue in Magento using layout xml directly simply add either <params>defer</params> or <params>defer</params> before </action> tag.

For example:

<action method="addJs"><script>prototype/prototype.js</script></action>

Replace it with following:

<action method="addJs"><script>prototype/prototype.js</script><params>defer</params></action>

or

<action method="addJs"><script>prototype/prototype.js</script><params>async</params></action>