-
Notifications
You must be signed in to change notification settings - Fork 37
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
Clarify what transferSize, encodedBodySize should return in various conditions #40
Comments
Also, is it correct if the transferSize is smaller than encodedBodySize in cases where the resource is cached, but we hit the network in order to revalidate, and transferSize is the size of the headers? |
Great feedback, we do need to clarify this stuff in the spec. Before I do though...
Right. It should return the sum of response headers and response payload body, regardless of response code (2xx, 3xx, 4xx, 5xx, ...)
Correct. Content-Length is also not guaranteed to be present.. so we want to report the actual number of bytes the client received.
Does that make sense? |
Yes, this sounds like a sane behaviour for the spec. |
- spell out cache vs network fetch behavior - notes for non-2xx responses closes #40
@valenting ptal at #41. |
Why encodedBodySize is 0 sometimes? |
Since we also return resource timing entries for cached resources, it should be specified if transferSize should return the same value it had during the first load, or just an estimation (body+headers).
Secondly, since we sometimes get 4XX/5XX responses with content, it needs to be clarified how we handle this case. I assume it would still return non-zero values, even if this is not the body of the resource we requested?
Also, while usually encodedBodySize is the same as the Content-Length response header, in some cases it could differ. I assume we want the actual number of bytes on the wire.
The text was updated successfully, but these errors were encountered: