Prefer Fetching Resources Asynchronously
For viewing all tips see here
Applicable To
All Browsers
How Improves Page Load Time
By optimizing browser rendering
Prologue
[Detail of the technology / concept being used in the tip if required]
Why
o When a browser comes across a ‘script’ tag, it waits for the script to download, parse and execute before rendering any HTML that comes after it. With asynchronous script, it is not an issue altogether.
o When a script is loaded asynchronously, it is fetched as soon as possible, but execution is deferred until Browser’s UI thread is not busy (e.g. rendering)
How
o Java Script code that is not required for initial view of the page (like tracking, analytics, hidden content) should be loaded asynchronously.
o Using a script DOM element with an ‘async’ attributes allows for asynchronous loading for most of the browsers whereas an HTML ‘script’ tag with an async attribute will only load asynchronously in FireFox and Chrome.
Exceptions
None
Recommendations
None
Comments
Post a Comment