MediaWiki is currently using
<script async="" src="/w/load.php?lang=nl&modules=startup&only=scripts&raw=1"></script>
Looking at w3schools that seems to be invalid syntax. Everywhere where I've seen the async keyword so far it's just been a simple async keyword. No = and no ="". Could that be a bug? Dunno if a separate ticket for that is worth it. What I was actually wondering about...
I haven't seen this discussed before here.
Some articles I was reading on the subject and found informative:
Specifically useful I found these images:
- async: https://kadiska.com/wp-content/uploads/2020/12/async-with-stop-parsing-1024x275.png
- defer: https://kadiska.com/wp-content/uploads/2020/12/defer-1024x337.png
My suggestion is inspired by PageSpeed insights.
The Critical Request Chains below show you what resources are loaded with a high priority. Consider reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load.
Similar to T107399.
To add further, potentially more authoritative sources, see this video by Google from minute 12:38 on the topic of defer, quote:
Scripts that use async may interrupt the browser from rendering other parts of the DOM.
Defer is more polite. It will also tell the browser that it can download and process all the stuff on the page, but it won't interrupt the browser to be executed. It will run after the page has been fully parsed. Defer is a great idea for anything that isn't critical for our initial viewport, things like libraries, video ...