-
Notifications
You must be signed in to change notification settings - Fork 6
Explainer for Timing Information of Static Routing API #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yoshisatoyanagisawa
merged 3 commits into
WICG:main
from
quasi-mod:add-resource-timing-api
May 13, 2024
Merged
Explainer for Timing Information of Static Routing API #25
yoshisatoyanagisawa
merged 3 commits into
WICG:main
from
quasi-mod:add-resource-timing-api
May 13, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adds the explainer for ServiceWorker Static Routing API resource timing.
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
May 10, 2024
This CL adds WPTs for Service Worker Static Routing API Resource Timing. It conducts a set of tests to determine if the resource timing is correctly working on each source type, and on main and sub-resources. Explainer: WICG/service-worker-static-routing-api#25 Bug: 41496865 Change-Id: Ide7d352d4824b9491645964febb6522ffe71aafb
yoshisatoyanagisawa
approved these changes
May 13, 2024
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
May 15, 2024
This CL adds WPTs for Service Worker Static Routing API Resource Timing. It conducts a set of tests to determine if the resource timing is correctly working on each source type, and on main and sub-resources. Explainer: WICG/service-worker-static-routing-api#25 Bug: 41496865 Change-Id: Ide7d352d4824b9491645964febb6522ffe71aafb
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
May 15, 2024
This CL adds WPTs for Service Worker Static Routing API Resource Timing. It conducts a set of tests to determine if the resource timing is correctly working on each source type, and on main and sub-resources. Explainer: WICG/service-worker-static-routing-api#25 Bug: 41496865 Change-Id: Ide7d352d4824b9491645964febb6522ffe71aafb
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
May 16, 2024
This CL adds WPTs for Service Worker Static Routing API Resource Timing. It conducts a set of tests to determine if the resource timing is correctly working on each source type, and on main and sub-resources. Explainer: WICG/service-worker-static-routing-api#25 Bug: 41496865 Change-Id: Ide7d352d4824b9491645964febb6522ffe71aafb
aarongable
pushed a commit
to chromium/chromium
that referenced
this pull request
May 20, 2024
This CL adds the relevant fields of load timing information for ServiceWorker Static Routing API. In detail, it adds two fields: `service_worker_router_evaluation_start` which tracks the time when router evaluation started, and `service_worker_cache_lookup_start` which tracks when the cache lookup started when the source is matched to `cache`. Explainer: WICG/service-worker-static-routing-api#25 Bug: 41496865 Change-Id: I9dd0566ad1f4f726f8b1d2f5258f0bca657070da Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5524581 Reviewed-by: Shunya Shishido <[email protected]> Reviewed-by: Yoshisato Yanagisawa <[email protected]> Commit-Queue: Keita Suzuki <[email protected]> Reviewed-by: Kenichi Ishibashi <[email protected]> Cr-Commit-Position: refs/heads/main@{#1303195}
aarongable
pushed a commit
to chromium/chromium
that referenced
this pull request
May 20, 2024
This CL adds timing information for ServiceWorker Static Routing API timing information. It adds two new fields to Resource Timing API and Navigation Timing API: RouterEvaluationStart and CacheLookupStart. This allows for developers to measure time such as time required for router evaluation, or cache lookup. Explainer: WICG/service-worker-static-routing-api#25 Bug: 41496865 Change-Id: I533d5ed96ce0fd013bf9ed2c2830dc389a2ea7db Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5505211 Reviewed-by: Yoshisato Yanagisawa <[email protected]> Reviewed-by: Kouhei Ueno <[email protected]> Reviewed-by: Takashi Toyoshima <[email protected]> Reviewed-by: Shunya Shishido <[email protected]> Commit-Queue: Keita Suzuki <[email protected]> Reviewed-by: Minoru Chikamune <[email protected]> Cr-Commit-Position: refs/heads/main@{#1303197}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
May 20, 2024
This CL adds WPTs for Service Worker Static Routing API Resource Timing. It conducts a set of tests to determine if the resource timing is correctly working on each source type, and on main and sub-resources. Explainer: WICG/service-worker-static-routing-api#25 Bug: 41496865 Change-Id: Ide7d352d4824b9491645964febb6522ffe71aafb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521193 Reviewed-by: Minoru Chikamune <[email protected]> Reviewed-by: Yoshisato Yanagisawa <[email protected]> Reviewed-by: Shunya Shishido <[email protected]> Reviewed-by: Kent Tamura <[email protected]> Commit-Queue: Keita Suzuki <[email protected]> Cr-Commit-Position: refs/heads/main@{#1303199}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
May 20, 2024
This CL adds WPTs for Service Worker Static Routing API Resource Timing. It conducts a set of tests to determine if the resource timing is correctly working on each source type, and on main and sub-resources. Explainer: WICG/service-worker-static-routing-api#25 Bug: 41496865 Change-Id: Ide7d352d4824b9491645964febb6522ffe71aafb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521193 Reviewed-by: Minoru Chikamune <[email protected]> Reviewed-by: Yoshisato Yanagisawa <[email protected]> Reviewed-by: Shunya Shishido <[email protected]> Reviewed-by: Kent Tamura <[email protected]> Commit-Queue: Keita Suzuki <[email protected]> Cr-Commit-Position: refs/heads/main@{#1303199}
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
May 23, 2024
…g API Resource Timing, a=testonly Automatic update from web-platform-tests Add WPTs for ServiceWorker Static Routing API Resource Timing This CL adds WPTs for Service Worker Static Routing API Resource Timing. It conducts a set of tests to determine if the resource timing is correctly working on each source type, and on main and sub-resources. Explainer: WICG/service-worker-static-routing-api#25 Bug: 41496865 Change-Id: Ide7d352d4824b9491645964febb6522ffe71aafb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521193 Reviewed-by: Minoru Chikamune <[email protected]> Reviewed-by: Yoshisato Yanagisawa <[email protected]> Reviewed-by: Shunya Shishido <[email protected]> Reviewed-by: Kent Tamura <[email protected]> Commit-Queue: Keita Suzuki <[email protected]> Cr-Commit-Position: refs/heads/main@{#1303199} -- wpt-commits: 1b18480d9b8d67d7e9eefa225277443503b2199b wpt-pr: 46182
jamienicol
pushed a commit
to jamienicol/gecko
that referenced
this pull request
May 24, 2024
…g API Resource Timing, a=testonly Automatic update from web-platform-tests Add WPTs for ServiceWorker Static Routing API Resource Timing This CL adds WPTs for Service Worker Static Routing API Resource Timing. It conducts a set of tests to determine if the resource timing is correctly working on each source type, and on main and sub-resources. Explainer: WICG/service-worker-static-routing-api#25 Bug: 41496865 Change-Id: Ide7d352d4824b9491645964febb6522ffe71aafb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5521193 Reviewed-by: Minoru Chikamune <[email protected]> Reviewed-by: Yoshisato Yanagisawa <[email protected]> Reviewed-by: Shunya Shishido <[email protected]> Reviewed-by: Kent Tamura <[email protected]> Commit-Queue: Keita Suzuki <[email protected]> Cr-Commit-Position: refs/heads/main@{#1303199} -- wpt-commits: 1b18480d9b8d67d7e9eefa225277443503b2199b wpt-pr: 46182
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the explainer for timing information for Static Routing API.
I will post the explainer in this comment as well for review purposes (the image might be broken due to link
issues. All the images are contained within the PR).
Explainer for timing info for Static Routing API
Authors
Participate
Abstract
Background
The ServiceWorker Static Routing API
The startup of ServiceWorkers, a web platform feature that brings application-like
experience to users, is known to be a slow process. If the ServiceWorker intercepts loading the page
resources, web users may need to wait for the startup to complete in order for the page loading to start.
Service Worker Static Routing API was introduced to mitigate this issue by letting the
developers selectively choose whether the ServiceWorker should intercept the
navigation, and allow them to specify when to not run ServiceWorker.
In addition, it allows the developers to offload simple ServiceWorker operations
like cache look up. i.e. they can return resources from CacheStorage without running
ServiceWorkers.
Timing Info of ServiceWorkers
Service Worker provides timing information to mark certain points
in time. This is exposed and used by the navigation timing API
as well as the resource timing API. It currently records two times:
However, it currently does not have any fields related to the ServiceWorker Static
Routing API. Developers would benefit from having fields that provide information such as:
This information will allow developers to measure the latency incurred by the Static
Routing API such as router evaluation time or time required to conduct cache lookup,
or determine if the matched source is the final source used (can find out if the
matched source failed to get the resource or not, and which source was used as
the alternative).
Proposal
We add the following two timing information:
DOMHighResTimeStamp
, initially 0DOMHighResTimeStamp
, initially 0In addition to the timestamp information, we also add the following two route source information:
RouterSource
, initially empty stringRouterSource
, initially empty stringExample code
Fetch Rule Specified
Network Rule Specified
Race Rule Specified
Cache Rule Specified
Recorded timing per matched route
As mentioned above, the recorded fields will be different depending on the matched source. The fields to be recorded per source is as follows (✔ indicates recorded, ✘ indicates not recorded).
RouterEvaluationStart
CacheLookupStart
fetchStart
Correspondence of the Matched Source Type and the Actual Source Type
In some situations, the actual source type will be different from the matched source
type. This includes cases such as "race-network-and-fetch-event" where the result
of the race will be the actual route, or "cache" where a cache miss occurs.
The full list of correspondence of the matched source type and the actual source
type is as follows:
(Fallback: Fetch handler is invalid)
(Fetch win)
(Network win or Fetch fallback)
(Fallback: Cache Missed)
(Cache hit)
Discussions
What to include in actual source when there is no matched source
When no matching rule is found,
matchedRouterSource
is an empty string, and we usethe ServiceWorker to fetch the resources. To indicate this case, there is a
discussion on what the
finalRouterSource
field should contain. We came up withtwo possible solutions:
finalRouterSource
as wellfinalRouteSource
("fetch-event" or "network", if it falls back)We are currently planning to pursue Solution 1.
Solution 2 does expose more information to developers, but the exposed information
is independent from ServiceWorker Static Routing API as it is about whether
ServiceWorker fetch has succeeded or not. Although this should be taken into
consideration in the future, we concluded that such information would be out of
scope of Timing Info for the API.
fetchStart
on Cache HitWhen the cache is specified as the source and the resource is found in the cache
(cache hit), no fetch operation is performed. Therefore, fetchStart will not be set.