Preload Scanner and fetchpriority Attribute
Speculative HTML scanner discovering critical resources before JS execution, paired with fetchpriority to reorder the HTTP/2-HTTP/3 queue.
About this page
LCP Prioritization: Default vs fetchpriority='high'
<img src="/hero.webp" alt="Product" />
<!-- Queued at Low priority until Layout -->Delayed behind defer/async scripts.
<img src="/hero.webp" alt="Product"
fetchpriority="high" decoding="sync" />Scheduled as soon as the Preload Scanner parses it.
Under the Hood#
Treat the Preload Scanner as an airport baggage advance scout: while the main HTML parser is stuck at security behind a blocking <script>, the scanner sprints ahead through the raw byte stream and puts critical luggage on the conveyor belt early.
- As soon as the first HTML packets arrive, a dedicated thread (Preload Scanner) extracts
<link>,<script>, and<img>tags before DOM construction completes for the Browser Rendering Pipeline. - By default, Blink queues images at
Lowpriority and only promotes in-viewport images toHighafter the first Layout pass. fetchpriority="high"assignsHighpriority in the HTTP/2 or HTTP/3 queue immediately upon HTML discovery, whilefetchpriority="low"demotes carousel slides out of the way.
<!-- Discovered in the first TCP window; queued ahead of deferred scripts -->
<img
src="/hero-banner.avif"
width="1200"
height="640"
fetchpriority="high"
decoding="async"
alt="Dashboard overview"
/>Problem Genealogy#
- 2008 (Preload Scanner): Workaround for synchronous
<script>tags stalling downstream resource discovery. - 2016 (
<link rel="preload">): Early discovery for resources hidden inside CSS/JS, frequently abused by pasting 12 preload tags in<head>and saturating the connection. - 2023+ (
fetchpriorityBaseline): Fine-grained relative priority control without duplicating preload tags.
Production Pitfalls#
- Client-injected LCP images: The Preload Scanner cannot see images mounted dynamically by React/SPA bundles until an Event Loop task executes JS, by which time your LCP budget is already half-spent.
- Overusing
fetchpriority="high": Marking 10 images ashighcancels prioritization benefits and delays critical stylesheets.
Where this connects
Prerequisites
Browser Rendering Pipeline (Critical Rendering Path)
Governs availability of critical resources (CSS, fonts, LCP hero image) prior to first Paint.
Next & related
Content Security Policy Nonces and strict-dynamic
The browser HTML parser and preload scanner evaluate script nonces before executing fetched scripts.
DOM & CSSOM Construction
Preload scanner discovers blocked CSS and JS assets before the main parser stalls.
103 Early Hints
103 Early Hints feed the same speculative preload queue before the HTML parser even starts.
Font Loading & CLS Mechanics
Preloading critical WOFF2 subsets starts font downloads before CSSOM parsing finishes.
HTTP/2 & HTTP/3 Multiplexing
The preload scanner queues concurrent asset fetches that rely on multiplexed streams.
Import Maps & Browser-Native Module Resolution
Nested import-map subgraphs still require modulepreload links so the preload scanner fetches deep dependencies early.
Responsive Images & Decoding
The HTML preload scanner evaluates srcset, sizes, and fetchpriority before CSS layout runs.
Streaming SSR & Progressive Flushing
Flushing <head> early lets the preload scanner fetch CSS and JS while the server awaits DB queries.
Speculation Rules & Prerendering
Preload scanner prioritizes current-page subresources, while Speculation Rules prerender next-page navigations.
Mechanical Comparisons
- Contrasts WithES Modules and Live Bindings vs Preload Scanner and fetchpriority Attribute
Nested ES module imports cannot be discovered by the HTML preload scanner without modulepreload hints.
- Contrasts WithPreload Scanner and fetchpriority Attribute vs Speculation Rules & Prerendering
Preload scanner prioritizes current-page subresources, while Speculation Rules prerender next-page navigations.