PerformanceNavigationTiming: criticalCHRestart property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
A website can indicate that a particularClient Hint is critical to the page by including it in aCritical-CH HTTP response header (as well as theAccept-CH HTTP request header which is needed for all client hints whether critical or not). Doing so will trigger a connection restart if the hint listed in theCritical-CH HTTP response header could have been, but wasn't, included in the HTTP request initially sent. If the browser does not support that client hint, it is ignored and no connection restart occurs.
ThecriticalCHRestart read-only property represents the time at which the connection restart occurred.
In this article
Value
ADOMHighResTimeStamp representing the number of milliseconds elapsed sincePerformanceEntry.startTime when the connection restart occurred in milliseconds.
If the value is0 the connection was not restarted.
Examples
>Detecting connection restart pages
The following JavaScript can be used to see if the connection was restarted:
const restartTime = performance?.getEntriesByType?.("navigation")[0]?.criticalCHRestart;if (restartTime > 0) { console.log("Time at which connection restart happened:", restartTime);}Specifications
| Specification |
|---|
| Navigation Timing Level 2> # dom-performancenavigationtiming-criticalchrestart> |