Font-awesome CDN JS showing as render-blocking on Pagespeed Insights
As mentioned in @GramThanos's comment, everything inside the <head>
is render-blocking. Font-awesome CDN makes the CSS load asynchronously which does speed it up but Google would still see the JS as render-blocking.
Moving the JS near the end of the <body>
helped it to not be render-blocking and also get rid of the PageSpeed Insights warning.
As noted above, everything in the <head>
is render-blocking.
Another approach is to include the async or defer attributes in the tag:
<script async src="https://use.fontawesome.com/mycustomcode.js"></script>
or
<script defer src="https://use.fontawesome.com/mycustomcode.js"></script>
@Anupam suggested (rightly) moving the tag to the end of the body, but even FontAwesome suggests including the defer attribute too.
Flavio Copes has a good explanation of script async vs. defer.