Bug 1915852 - Document fetch priority impact on CSS, JS r=necko-reviewers,valentin DONTBUILD

Update prioritization, scheduling to include CSS, JS specifics.

Differential Revision: https://phabricator.services.mozilla.com/D236267
This commit is contained in:
Andrew Creskey
2025-01-31 20:19:31 +00:00
parent 83816c4757
commit f948119d9e

View File

@@ -40,15 +40,15 @@ These priorities are calculated based on the following factors:
| **Resource Type** | **Class of Service** | **supportsPriority** | **Urgency** | **Incremental** | **Notes** |
|--------------------------------------|------------------------------------------|--------------------------------------------------------------------------------------|-----------------------------------------------|-----------------|---------------------------------------------------------------------------|
| **HTML, Root Document** | `UrgentStart (64)` | `PRIORITY_HIGHEST, -20` | `0` | `true` | |
| **CSS (`<head>`, Render-Blocking)** | `Leader (1)` | `PRIORITY_NORMAL, 0` | `2` | `false` | |
| **CSS (rel=preload)** | `Leader (1)` | `PRIORITY_HIGHEST, -20` | `0` | `false` | |
| **CSS (Body)** | `Leader (1)` | `PRIORITY_NORMAL, 0` | `2` | `false` | |
| **JavaScript (Blocking)** | `Leader (1)` | `PRIORITY_NORMAL, 0` | `2` | `false` | |
| **JavaScript (rel=preload)** | `Unblocked (16)` | `PRIORITY_HIGHEST, -20` | `1` | `false` | |
| **JavaScript (Async)** | `TailAllowed (512), Unblocked (16)` | `PRIORITY_NORMAL, 0` | `3` | `false` | |
| **JavaScript (Defer)** | `Unblocked (16)` | `PRIORITY_NORMAL, 0` | `3` | `false` | |
| **Font @font-face** | `TailForbidden (1024)` | `PRIORITY_HIGH, -10` | `3` | `false` | Urgency affected by `TailForbidden` CoS |
| **Font (rel=preload)** | `TailForbidden (1024), Unblocked (16)` | `PRIORITY_HIGH, -10`<br>`fetchpriority=high: PRIORITY_HIGHEST, -20`<br>`fetchpriority=low: PRIORITY_LOW, 10` | `2`<br>`fetchpriority=high: 1`<br>`fetchpriority=low: 4` | `false` | |
| **CSS (`<head>`, Render-Blocking)** | `Leader (1)` | `PRIORITY_NORMAL, 0`<br>`fetchpriority=high: PRIORITY_HIGH, -20`<br>`fetchpriority=low: PRIORITY_LOW, 0` | `2` <br>`fetchpriority=high: 0`<br>`fetchpriority=low: 2` | `false` | |
| **CSS (rel=preload)** | `Leader (1)` | `PRIORITY_HIGHEST, -20`<br>`fetchpriority=high: PRIORITY_HIGH, -20`<br>`fetchpriority=low: PRIORITY_LOW, -10`| `0` <br>`fetchpriority=high: 0`<br>`fetchpriority=low: 1` | `false` | |
| **CSS (Body)** | `Leader (1)` | `PRIORITY_NORMAL, 0` <br>`fetchpriority=high: PRIORITY_HIGH, -20`<br>`fetchpriority=low: PRIORITY_NORMAL, 0` | `2` <br>`fetchpriority=high: 0`<br>`fetchpriority=low: 2`| `false` | |
| **JavaScript (Blocking)** | `Leader (1)` | `PRIORITY_NORMAL, 0` <br>`fetchpriority=high: PRIORITY_HIGH, -10`<br>`fetchpriority=low: PRIORITY_LOW, 10` | `2` <br>`fetchpriority=high: 1`<br>`fetchpriority=low: 3` | `false` | |
| **JavaScript (rel=preload)** | `Unblocked (16)` | `PRIORITY_HIGHEST, -20` <br>`fetchpriority=high: PRIORITY_HIGH, -20`<br>`fetchpriority=low: PRIORITY_LOW, 10`| `1` <br>`fetchpriority=high: 1`<br>`fetchpriority=low: 4` | `false` | |
| **JavaScript (Async)** | `TailAllowed (512), Unblocked (16)` | `PRIORITY_NORMAL, 0` <br>`fetchpriority=high: PRIORITY_HIGH, -10`<br>`fetchpriority=low: PRIORITY_LOW, 10` | `3`<br>`fetchpriority=high: 2`<br>`fetchpriority=low: 4` | `false` | |
| **JavaScript (Defer)** | `Unblocked (16)` | `PRIORITY_NORMAL, 0` <br>`fetchpriority=high: PRIORITY_HIGH, -10`<br>`fetchpriority=low: PRIORITY_LOW, 10` | `3`<br>`fetchpriority=high: 2`<br>`fetchpriority=low: 4` | `false` | |
| **Font @font-face** | `TailForbidden (1024)` | `PRIORITY_HIGH, -10` | `3` | `false` | Urgency affected by `TailForbidden` CoS. fetchpriority applied via rel="preload" |
| **Font (rel=preload)** | `TailForbidden (1024), Unblocked (16)` | `PRIORITY_HIGH, -10`<br>`fetchpriority=high: PRIORITY_HIGH, -10`<br>`fetchpriority=low: PRIORITY_LOW, 10` | `2`<br>`fetchpriority=high: 2`<br>`fetchpriority=low: 4` | `false` | |
| **Image** | `(0)` | `PRIORITY_LOW, 10`<br>`fetchpriority=high: PRIORITY_HIGH, -10`<br>`fetchpriority=low: PRIORITY_LOWEST, 20` | `5`<br>`fetchpriority=high: 3`<br>`fetchpriority=low: 6` | `true` | |
| **Image (rel=preload)** | `(0)` | `PRIORITY_LOW, 10`<br>`fetchpriority=high: PRIORITY_HIGH, -10`<br>`fetchpriority=low: PRIORITY_LOWEST, 20` | `4`<br>`fetchpriority=high: 3`<br>`fetchpriority=low: 5` | `true` | |
| **Image (About to Be Rendered)** | `(0)` | `PRIORITY_HIGH, -10` | `3` | `true` | See: [image_layout_network_priority](https://searchfox.org/mozilla-central/rev/a13db27562f9237db97e2ea5b01dc879d5b55b74/modules/libpref/init/StaticPrefList.yaml#7429-7431) and [bug 1915817](https://bugzilla.mozilla.org/show_bug.cgi?id=1915817) |