WICG / client-hints-infrastructure

Specification for the Client Hints infrastructure - privacy preserving proactive content negotiation
https://wicg.github.io/client-hints-infrastructure
Other
61 stars 26 forks source link

Feature request: additional request header to indicate a Critical-CH restart #87

Open amtunlimited opened 3 years ago

amtunlimited commented 3 years ago

Could be helpful for a number of reasons, including deduplication for analytics and better handling of still-missing headers.

Could call it Critical-CH-Restart or something, I'm thinking along the lines of Service-Worker-Navigation-Preload.

arichiv commented 3 years ago

@abeyad @miketaylr

abeyad commented 3 years ago

As a side note, I think Critical-CH-Restart should be a boolean; I don't think a count doesn't make sense since Critical-CH should only result in up to one resend of the request.

amtunlimited commented 3 years ago

@davidben since you own the spec (in a way), any thoughts?

@abeyad that's actually not quite true anymore. The Critical-CH restarts are now counted as part of the navigation redirect limit, so there could be a number of times.

That being said, there's a question of if the header should persist through a redirect chain, or just on the one "restarted" request. I was leaning towards just a boolean and not passed to the next redirect

davidben commented 3 years ago

better handling of still-missing headers

What kind of better handling were you envisioning? The server is equally obligated to respond to the missing headers in both requests. On the first request, if you send Critical-CH, the client may well choose not to restart, in which case the response is used as-is.

amtunlimited commented 3 years ago

I suppose I was envisioning a server seeing that header and gracefully handling, vs not seeing it and assuming it will be dropped, but that's probably not a good precedent to set

davidben commented 3 years ago

Yeah, such a server would break if the client doesn't support the hint, or declined to send it for some reason.