This is based on w3c/resource-timing#332. See also w3c/resource-timing#343, w3c/navigation-timing#163, WICG/nav-speculation#180.
Resources on the web are usually fetched via HTTP (from the origin server), but in some cases they are known to be delivered from a cache or other buffer, in a way that affects loading performance. Insight into this is useful for authors understanding when these caches accelerate resource loading.
The deliveryType
attribute on PerformanceResourceTiming
addresses this, with the following values:
""
- No more specific delivery type applies, most likely because the resource was fetched from its origin server. Also returned if the user agent doesn't wish to disclose the use of a cache, for security or privacy reasons.
"cache"
- The resource was served from the cache (i.e., the user agent's HTTP cache).
"navigational-prefetch"
- The resource was prefetched for navigation on another page (e.g., using speculation rules) and served from the prefetch buffer when navigation subsequently occurred.
w3c/resource-timing#303 discusses how consuming a preload ought to be exposed in the future; if it is, using another deliveryType
(e.g., "preload"
) would be viable. This is not yet proposed as of June 2023, however.