From 92b126ff07bf56320d2bc81b67d0e9abd0513fc7 Mon Sep 17 00:00:00 2001 From: Keita Suzuki Date: Mon, 26 May 2025 12:21:54 +0900 Subject: [PATCH 1/2] Add SW static routing API timing information to resource timing --- index.html | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/index.html b/index.html index 89e683c..1666516 100644 --- a/index.html +++ b/index.html @@ -370,6 +370,12 @@

readonly attribute DOMHighResTimeStamp firstInterimResponseStart; readonly attribute DOMHighResTimeStamp responseStart; readonly attribute DOMHighResTimeStamp responseEnd; + readonly attribute DOMHighResTimeStamp workerRouterEvaluationStart; + readonly attribute DOMHighResTimeStamp workerCacheLookupStart; + // Holds a value from RouterSourceEnum or empty string + readonly attribute DOMString workerMatchedRouterSource; + // Holds a value from RouterSourceEnum (excluding "race-network-and-fetch-handler") or empty string + readonly attribute DOMString workerFinalRouterSource; readonly attribute unsigned long long transferSize; readonly attribute unsigned long long encodedBodySize; readonly attribute unsigned long long decodedBodySize; @@ -420,6 +426,11 @@

{{RenderBlockingStatusType}} render-blocking status.

+

+ A PerformanceResourceTiming has an associated + [=service worker timing info=] service worker timing. +

When toJSON is called, run the [=default toJSON steps=] for {{PerformanceResourceTiming}}. @@ -722,6 +733,26 @@

info's [=fetch timing info/render-blocking=] is true; otherwise non-blocking.

+

+ The workerRouterEvaluationStart getter steps are to return + this's service worker + timing info's [=service worker timing info/worker router evaluation start=]. +

+

+ The workerCacheLookupStart getter steps are to return + this's service worker + timing info's [=service worker timing info/worker cache lookup start=]. +

+

+ The workerMatchedRouterSource getter steps are to return + this's service worker + timing info's [=service worker timing info/worker matched router source=]. +

+

+ The workerFinalRouterSource getter steps are to return + this's service worker + timing info's [=service worker timing info/worker final router source=]. +

A user agent implementing PerformanceResourceTiming would need to include "resource" in From b63ff0241e84d7bc1c296882d6fad213295ffda2 Mon Sep 17 00:00:00 2001 From: Keita Suzuki Date: Thu, 29 May 2025 13:27:14 +0900 Subject: [PATCH 2/2] Update service worker timing info to be collected from fetch timing info --- index.html | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index 1666516..f8e8889 100644 --- a/index.html +++ b/index.html @@ -372,9 +372,7 @@

readonly attribute DOMHighResTimeStamp responseEnd; readonly attribute DOMHighResTimeStamp workerRouterEvaluationStart; readonly attribute DOMHighResTimeStamp workerCacheLookupStart; - // Holds a value from RouterSourceEnum or empty string readonly attribute DOMString workerMatchedRouterSource; - // Holds a value from RouterSourceEnum (excluding "race-network-and-fetch-handler") or empty string readonly attribute DOMString workerFinalRouterSource; readonly attribute unsigned long long transferSize; readonly attribute unsigned long long encodedBodySize; @@ -426,11 +424,6 @@

{{RenderBlockingStatusType}} render-blocking status.

-

- A PerformanceResourceTiming has an associated - [=service worker timing info=] service worker timing. -

When toJSON is called, run the [=default toJSON steps=] for {{PerformanceResourceTiming}}. @@ -735,23 +728,27 @@

The workerRouterEvaluationStart getter steps are to return - this's service worker - timing info's [=service worker timing info/worker router evaluation start=]. + this's timing info's + [=fetch timing info/service worker timing info=]'s + [=service worker timing info/worker router evaluation start=].

The workerCacheLookupStart getter steps are to return - this's service worker - timing info's [=service worker timing info/worker cache lookup start=]. + this's timing info's + [=fetch timing info/service worker timing info=]'s + [=service worker timing info/worker cache lookup start=].

The workerMatchedRouterSource getter steps are to return - this's service worker - timing info's [=service worker timing info/worker matched router source=]. + this's timing info's + [=fetch timing info/service worker timing info=]'s + [=service worker timing info/worker matched router source=].

The workerFinalRouterSource getter steps are to return - this's service worker - timing info's [=service worker timing info/worker final router source=]. + this's timing info's + [=fetch timing info/service worker timing info=]'s + [=service worker timing info/worker final router source=].

A user agent implementing PerformanceResourceTiming would need