Home / Tutorials / PrestaShop 1.7 Tutorials / How to Defer Parsing of JavaScript in prestashop

How to Defer Parsing of JavaScript in prestashop

How does JS affect the SiteSpeed ?

First of all, JavaScript(s) are one of the major culprits to make your website slow. The web browser comes across a script, it executes the script first before continue to load HTML that includes the content users are looking for. For a browser, executing a JavaScript is a heavier task (depending on the size of the script) and takes more time as compared to render the meaningful content (the first paint) of the webpage. Hence JavaScript affects the critical rendering path and slows down pagespeed of your website. Why not defer this heavier task of JS execution so that critical rendering path remain uninterrupted, right?

Follow these step to Defer Parsing of JavaScript in prestashop :

–  Add “async” into The code <script type=”text/javascript”> of file Root/themes/THEME_NAME/templates/_partials/javascript.tpl

– Turn on cache & compress css,js in Prestashop

– Checking it with GTMetrix website https://gtmetrix.com/reports/demo1.leotheme.com/401sex7a 

 

About Leo Theme

Check Also

Leotheme Black Friday 2022

Prestashop Theme and Module Black Friday and Cyber Monday Sales Leotheme 2022 30% Off

Prestashop Leotheme Black Friday 2022 Promotion! Dear valued customers, Black Friday and Cyber Monday Sales …

Leave a Reply