How to make JS Async and eliminate unnecessary JS? I've been told this could be done with the Magic module but I couldn't find documentation\videos\readme anywhere for it so I ask how to do these specific things with it in my Drupal 7 site:


How to make JS Async?
How to eliminate unnecessary JS?


I need this for trying to take care the known Page spped insights advice "Eliminate render blocking JS above the fold content". Thanks.

Update: This could be done with AdvAgg module easily, see the following answer by Mikeytown2:
you can use async_js for loading asynchronly.

and in hook_js_alter you can remove js files you don't want to have on the page.

you can also place the JS at the bottom of the page in your theme's html.tpl.php, by printing

&lt;?php print $scripts; ?&gt;

just before the &lt;/body&gt; tag.