Skip to content
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

deliveryType (Resource Timing) #858

Closed
1 task done
jeremyroman opened this issue Jun 13, 2023 · 5 comments
Closed
1 task done

deliveryType (Resource Timing) #858

jeremyroman opened this issue Jun 13, 2023 · 5 comments

Comments

@jeremyroman
Copy link

こんにちは TAG-さん!

I'm requesting a TAG review of deliveryType (part of Resource Timing).

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), "cache" (the resource was served from the cache), "navigational-prefetch" (the resource was prefetched for navigation from another page).

Further details:

  • I have reviewed the TAG's Web Platform Design Principles
  • Relevant time constraints or deadlines: I am hoping to ship this single attribute addition relatively soon in Chrome. It has previously been discussed in the WPWG context, but as part of this process it was suggested that we get TAG's opinion as well. A quick response would be appreciated; I hope that given the small scope of this feature and prior attention that significant revision won't be necessary.
  • The group where the work on this specification is currently being done: Web Performance Working Group
  • The group where standardization of this work is intended to be done (if current group is a community group or other incubation venue): Web Performance Working Group
  • Major unresolved issues with or opposition to this specification: none known
  • This work is being funded by: Google LLC

We'd prefer the TAG provide feedback as (please delete all but the desired option):
💬 leave review feedback as a comment in this issue and @-notify @jeremyroman

@jeremyroman
Copy link
Author

Anticipating one possible question -- the type of the attribute is DOMString. Since this values is only provided to clients and not accepted from them, I believe this is indistinguishable from an enum from the author's perspective, and was chosen for consistency with most other values exposed on this object.

If an enum would be preferred (I believe this is still forward-compatible for the addition of new types in the future), that seems like a change that would be possible to make to the specification without any change to author code.

@hober
Copy link
Contributor

hober commented Aug 1, 2023

Since there are more than one kind of cache, is the single "cache" value sufficient?

@atanassov
Copy link

An effort that needs to be considered is the Sustainability of Bundling and Caching. In case that privacy approach becomes adopted your proposed API should probably apply similar heuristics and "masking" of the results.

@jeremyroman
Copy link
Author

There are many kinds of cache, yeah. In the context of PerformanceResourceTiming I think it's most natural to describe the HTTP cache (whether it has one layer or multiple), and that's what people usually seem to mean by "the cache" in this context.

Some caches (e.g., an image decode cache) probably don't make sense to describe as part of resource loading.

Some caches (e.g., a caching forward proxy, reverse proxy or CDN) are outside the user agent proper and I would think probably don't make sense to describe here (but server timing might be appropriate). If we did want to describe it in deliveryType in the future, I think it would be natural for it to have a different enumerator.

The service worker and preload caches are probably the two most potentially interesting cases I'm aware of. Consuming resources from the preload cache isn't currently exposed, and if it were to be (w3c/resource-timing#303), I think a separate enumerator would be justified and would be reasonably clear, since it's generally not described as a "cache" elsewhere in its API (deliveryType: "preload" or similar).


re. sustainability of bundling and caching, there doesn't seem to be enough detail there yet to strongly reason about its implications if adopted, but if it becomes necessary to obscure the cache state of certain resources I agree that similar masking might be applicable here. I would hope that at same-origin resources, at least, wouldn't require such masking.

@ylafon ylafon self-assigned this Aug 21, 2023
@torgo torgo modified the milestones: 2023-08-28-week, 2023-09-04-week Sep 3, 2023
@torgo torgo modified the milestones: 2023-09-04-week, 2023-10-09-week Oct 8, 2023
@ylafon ylafon added the Progress: propose closing we think it should be closed but are waiting on some feedback or consensus label Oct 9, 2023
@ylafon
Copy link
Member

ylafon commented Jan 8, 2024

Sorry it took a long time to close this, but as hinted above, we don't have any issue with this.

@ylafon ylafon closed this as completed Jan 8, 2024
@ylafon ylafon added Resolution: satisfied The TAG is satisfied with this design and removed Progress: propose closing we think it should be closed but are waiting on some feedback or consensus labels Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants