async attribute or the
This behavior is therefore render-blocking and can delay the overall page load if many and/or large resources need to be fetched.
In the asynchronous way, the
async attribute need to be added to the
<script> tag. This way, the script is fetched asynchronous without blocking the parser. Once the script is fetched, the parsing is paused to execute the script.
In the deferred way, you need, like in the async way, add an attribute (
defer) to the
<script> tag. In this way, the script is fetched in the same way as in the asynchronous one, but doesn’t get executed until the parser has finished.
[sc name=”src” url=”https://bitsofco.de/async-vs-defer/” ]