Description
Timing-Allow-Origin
(defined in the fetch spec) is a header that signals the user agent that particular timing-related characteristics of fetching a resource should be visible to the requesting origin, irrespective of whether it was requested via CORS.
Since its inception, several new additions were proposed to resource timing, and more often than not it was unclear whether this opt-in is a sufficient signal that it's OK to expose this particular bit of information.
Those so far include exposing content-type
, the status code, and content-encoding
(see w3c/resource-timing#411 and whatwg/fetch#1796 for the latter).
With each of these, and potentially with future additions in mind, we would like to have a clear general guidelines of what is "OK" to expose for cross-origin resources that are served with the appropriate Timing-Allow-Origin
header, what requires CORS, and what has to be same-origin.
There are roughly three ways to go about it (from conservative to relaxed)
- We don't add more things that
Timing-Allow-Origin
can expose, as to not overload new meanings on old opt-ins. Timing-Allow-Origin
can expose only values that are specifically timing values, as in durations and timestamps.Timing-Allow-Origin
can expose anything that is information about the fetch, but is not information about the resource itself. i.e., if the response was cached and retrieved in a service worker you'd get a different result.
Would love to have some collective thoughts about it and reach a guideline before we ship anything new in resource timing.
/cc @yoavweiss @annevk @achristensen07 @camillelamy @arturjanc @ddworken