w3c / resource-timing

Resource Timing
https://w3c.github.io/resource-timing/
Other
121 stars 35 forks source link

Add a revalidation cache state and adapt transferSize to it #272

Closed yoavweiss closed 3 years ago

yoavweiss commented 3 years ago

Complementary PR to https://github.com/whatwg/fetch/pull/1232

While implementing the recent Resource Timing transferSize changes, I realized that the current spec is not sufficient to implement what was discussed in the WG, and more importantly, insufficient to maintain backwards compatibility with current transferSize values.

Essentially, we want transferSize to return different values for the cases of local caching (in which case it needs to return 0), full fetch from the network (in which case it needs to return the encoded body size + a constant) as well as the successful revalidation case (where it needs to return just the constant representing the headers used to revalidate the response).


Preview | Diff

yoavweiss commented 3 years ago

@achristensen07 - I missed the fact that this PR hasn't landed yet in yesterday's call. Can you maybe take a look?