Here is how you may want to tune up your WordPress website performance, i.e., how long it takes to download your website from the server to your visitors’ computer, mobile or tablet.
In the era of responsive design, we tend to embed more than one Javascript or CSS file, such as Bootstrap CSS and JS file bundles.
If you have integrated third-party advertising into your website, vendors like Google add their own Javascript file through their AdSense ad code that you can’t control.
But here is a simple way out of this problem.
Important Note:
Compressing, Minifying, or Deferring Files may harm the website’s functionality because of dependencies, so first, do the following steps on your local server. If everything looks to be working fine, you can update the duplicate files on Live servers—just for safety and security purposes.
When you ‘Analyse’ your website on Google PageSpeed, you get a warning something like this:
Your page has 4 blocking script resources and 8 blocking CSS resources. This causes a delay in rendering your page.
None of the above-the-fold content on your page could be rendered without waiting for the following resources to load. Try to defer or asynchronously load blocking resources or inline the critical portions of those resources directly in the HTML.
Solution 01:
The safest way of Deferring JavaScript ‘JS’ would be the following
Step 01:
Add the word ‘async’ at the closing tag called ‘</script>’, So your code will not block loading any other resources.
Step 02:
Add the same line of code just before closing the footer tag so your code is already asynchronous (async). After moving the same code to the footer, it will load after the website loading.
(more…)