How and when to use Async and Defer attributes
Published on:Both async
and defer
attributes look like they do the same thing at first glance, but there are nuances to async
and defer
. Most of the time, you'd want to use defer
instead of async
, even though async
sounds sexier.
But why?
I'd like to walk you through the differences and why you should use them (and also why you don't have to use them).