There are some (admittedly edge case) scenarios where async is still desirable. For example on the BBC News homepage if we loaded our scripts with defer, a bunch of non-defer third-party scripts would execute first and make the page feel slow. We used async instead, so that parsing isnโt blocked while the script is being fetched but it is blocked once the script is available so we can enhance the page and make it feel complete without having to wait for other scripts to execute first.
Thanks for writing this, I found very little information online on when to use async is a better choice, I added a bit more information to consider this scenario ๐๐ผ
So why would you use
asyncat all? And why do newer browsers even bother to support it?There are some (admittedly edge case) scenarios where async is still desirable. For example on the BBC News homepage if we loaded our scripts with defer, a bunch of non-defer third-party scripts would execute first and make the page feel slow. We used async instead, so that parsing isnโt blocked while the script is being fetched but it is blocked once the script is available so we can enhance the page and make it feel complete without having to wait for other scripts to execute first.
Thanks for writing this, I found very little information online on when to use
asyncis a better choice, I added a bit more information to consider this scenario ๐๐ผ