# Preload Scanner and fetchpriority Attribute vs Speculation Rules & Prerendering

- **Canonical URL:** https://frontend.rocks/vs/preload-scanner-hints-vs-speculation-rules-prerender/
- **Relation:** Contrasts With
- **Last Verified:** 2026-11-15
- **Verdict:** Preload scanner prioritizes current-page subresources, while Speculation Rules prerender next-page navigations.

## Comparison Matrix

| Dimension | Preload Scanner and fetchpriority Attribute | Speculation Rules & Prerendering |
| :--- | :--- | :--- |
| **Maturity** | Baseline · Newly | Experimental |
| **Domain** | Network & Performance | Network & Performance |
| **Mental Model** | Speculative HTML scanner discovering critical resources before JS execution, paired with fetchpriority to reorder the HTTP/2-HTTP/3 queue. | Declarative JSON rules that prefetch or fully prerender predicted next navigations in a hidden browsing context, delivering near-instant 0 ms LCP on click. |
| **Prerequisites** | None | None |
| **When Not to Use** | When not to use fetchpriority="high": Never apply it to below-the-fold images or secondary web fonts; for cross-page navigation speedups, use Speculation Rules instead. | When not to use prerender: Avoid prerendering URLs with server-side side effects (logout links, add-to-cart GET endpoints) or pages heavy on WebGL/video memory. |

## Preload Scanner and fetchpriority Attribute — 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.

1. 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](/concepts/browser-rendering-pipeline).
2. By default, Blink queues images at `Low` priority and only promotes in-viewport images to `High` after the first Layout pass.
3. `fetchpriority="high"` assigns `High` priority in the HTTP/2 or HTTP/3 queue immediately upon HTML discovery, while `fetchpriority="low"` demotes carousel slides out of the way.

```html
<!-- 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"
/>
```

## Speculation Rules & Prerendering — Under the Hood
While [bfcache](/concepts/bfcache-navigation) handles instant Back/Forward navigation and the [Preload Scanner](/concepts/preload-scanner-hints) handles subresources on the current page, Speculation Rules tackle forward clicks. Think of it as staging the next theater set behind a closed curtain before the scene change.

1. A `<script type="speculationrules">` block (or `Speculation-Rules` HTTP header) defines `prefetch` or `prerender` rules using URL lists or CSS `where` selectors.
2. When an `eagerness` trigger fires (`moderate` on 200 ms hover, `conservative` on pointerdown), the engine allocates an isolated hidden browsing context.
3. The hidden document parses HTML, runs JS, and paints frames, while blocking intrusive APIs (camera, audio, `alert`) until activation.
4. On click, `document.prerendering` flips from `true` to `false` and `prerenderingchange` fires.

```html
<script type="speculationrules">
{
  "prerender": [{
    "where": { "href_matches": "/docs/*" },
    "eagerness": "moderate"
  }]
}
</script>
```

## Interactive Labs & Dissections
- [Preload Scanner and fetchpriority Attribute Lab](https://frontend.rocks/concepts/preload-scanner-hints/#lab) ([Markdown](https://frontend.rocks/concepts/preload-scanner-hints.md))
- [Speculation Rules & Prerendering Lab](https://frontend.rocks/concepts/speculation-rules-prerender/#lab) ([Markdown](https://frontend.rocks/concepts/speculation-rules-prerender.md))

## Primary Sources
- https://web.dev/articles/fetch-priority
- https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/fetchPriority
- https://developer.mozilla.org/en-US/docs/Web/API/Speculation_Rules_API
- https://developer.chrome.com/docs/web-platform/prerender-pages
- https://wicg.github.io/nav-speculation/speculation-rules.html
