preload scanner
A secondary parser that skims ahead through the HTML while the main parser is blocked and starts downloading scripts, stylesheets, fonts and images early.
In more detail
When a synchronous script stops the main parser, the preload scanner keeps reading the markup on a background thread and requests the resources it finds. It cannot see resources that JavaScript adds later, which is why preload hints exist.
Related terms
- HTML parser — The part of the browser that reads HTML text and builds the DOM tree from it, one token at a time.
- preload — A resource hint, <link rel="preload">, that makes the browser download a file needed for the current page right away at high priority.
- render-blocking resource — A file, usually a stylesheet in the head or a synchronous script, that the browser must finish loading before it will draw the page.
Taught in
- HTML Parsing, Tokenization And The Document Object Model (DOM) — Frontend Architecture & Web Platform
- Critical Rendering Path: Preload, Prefetch And Scripts — Frontend Architecture & Web Platform