client-hints-infrastructure icon indicating copy to clipboard operation
client-hints-infrastructure copied to clipboard

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

Open amtunlimited opened this issue 3 years ago • 6 comments

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.

amtunlimited avatar Oct 06 '21 22:10 amtunlimited

@abeyad @miketaylr

arichiv avatar Oct 07 '21 15:10 arichiv

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.

abeyad avatar Oct 07 '21 17:10 abeyad

@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

amtunlimited avatar Oct 07 '21 18:10 amtunlimited

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.

davidben avatar Oct 07 '21 18:10 davidben

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

amtunlimited avatar Oct 07 '21 18:10 amtunlimited

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

davidben avatar Oct 07 '21 18:10 davidben