Skip to content
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

Add criticalCHRestart #188

Merged
merged 4 commits into from Jun 7, 2023
Merged

Add criticalCHRestart #188

merged 4 commits into from Jun 7, 2023

Conversation

arichiv
Copy link
Member

@arichiv arichiv commented Mar 21, 2023

Website can indicate that a particular Client Hint is critical to the page by including it in a Critical-CH HTTP response header. Doing so will trigger a connection restart if the hint listed in the Critical-CH HTTP response header could be (but wasn't) included in the HTTP request initially sent. We should indicate this has happened in Navigation Timing so that developers can know if a restart occurred and impacted timing.

We can pull this from the navigable but I'm not quite sure if this is the right way to thread it.

Closes #177


Preview | Diff

Website can indicate that a particular Client Hint is critical to the
page by including it in a `Critical-CH` HTTP response header. Doing so
will trigger a connection restart if the hint listed in the
`Critical-CH` HTTP response header could be (but wasn't) included in the
HTTP request initially sent. We should indicate this has happened in
Navigation Timing so that developers can know if a restart occurred and
impacted timing.

We can pull this from the [navigable](https://wicg.github.io/client-hints-infrastructure/#has-reloaded-for-critical-ch) but I'm not quite sure if this
is the right way to thread it.

Closes #177
@yoavweiss yoavweiss requested a review from noamr March 22, 2023 09:35
@noamr
Copy link
Contributor

noamr commented Mar 22, 2023

Is this specific to navigations? Subresources don't support this behavior?

@arichiv
Copy link
Member Author

arichiv commented Mar 22, 2023

Yes that's correct. Just top-level navigations too (not iframes).

@noamr
Copy link
Contributor

noamr commented Mar 22, 2023

Yes that's correct. Just top-level navigations too (not iframes).

Great!
Do we know the timing of that restart? Maybe it should be a timestamp rather than a boolean? Isn't there some point in time where the UA decided to re-send the navigation or so?

@arichiv
Copy link
Member Author

arichiv commented Mar 23, 2023

Done @noamr

@arichiv arichiv changed the title Add criticalCHRestartOccured Add criticalCHRestart Mar 23, 2023
@noamr
Copy link
Contributor

noamr commented Mar 23, 2023

OK I'm missing two things here. without them this feels a bit hypothetical:

  1. where do we set this new value
  2. Web platform tests that show how it's used

@arichiv
Copy link
Member Author

arichiv commented Mar 27, 2023

If this looks good otherwise, I believe that:

  1. Is resolved by modifying https://wicg.github.io/client-hints-infrastructure/ to set it and
  2. Is resolved after Chrome implements and tests.
    Sounds like this is paused until after those happen.

@noamr
Copy link
Contributor

noamr commented Mar 27, 2023

It's true this isn't reflected in other specs, including the DNT spec itself: "Ideally, the value of Navigator.doNotTrack ought to reflect the current set of user-granted exceptions in effect when the attribute is read." https://www.w3.org/TR/tracking-dnt/#expressing

I think it's worth requiring locked consistency within a given navigation for all subresources and subframes as that seems the most correct/consistent approach and this spec is still being incubated, but I'd also be fine with unifying HTTP/JavaScript approaches the other direction and always using the 'live' value of the preference if that's what you're saying.

Not sure what you're responding to. Perhaps a different issue?

@arichiv
Copy link
Member Author

arichiv commented Mar 27, 2023

Sorry, yes. Just updated the comment

@noamr
Copy link
Contributor

noamr commented Mar 27, 2023

If this looks good otherwise, I believe that:

  1. Is resolved by modifying https://wicg.github.io/client-hints-infrastructure/ to set it and
  2. Is resolved after Chrome implements and tests.
    Sounds like this is paused until after those happen.

Yea, would like to see the whole picture. It's difficult to review addition of a new attribute without this context.

@arichiv
Copy link
Member Author

arichiv commented Mar 27, 2023

Awesome, will check back in a couple weeks or so when that's done.

@arichiv
Copy link
Member Author

arichiv commented May 19, 2023

The WPTs just went in: https://chromium-review.googlesource.com/c/chromium/src/+/4538244
Is this the right way to do the patching to set the time in the spec: WICG/client-hints-infrastructure#153

@arichiv
Copy link
Member Author

arichiv commented Jun 1, 2023

@noamr any feedback on WICG/client-hints-infrastructure#153?

arichiv added a commit to WICG/client-hints-infrastructure that referenced this pull request Jun 7, 2023
* Update Critical-CH restart time in navigation params

This is needed for w3c/navigation-timing#188.

* Update index.bs

* Update index.bs

* Update index.bs

* Update index.bs

* Update index.bs

* Update index.bs

* Update index.bs

* Update index.bs

* Update index.bs

* Update index.bs

* Update index.bs
@arichiv
Copy link
Member Author

arichiv commented Jun 7, 2023

The other PR is in, can this be committed @noamr?

@noamr noamr merged commit 74203fb into w3c:gh-pages Jun 7, 2023
2 checks passed
@arichiv arichiv deleted the critical-ch branch June 7, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report that Critical-CH was used to restart a navigation
2 participants