- From: Shunya Shishido <notifications@github.com>
- Date: Sun, 07 Dec 2025 21:55:30 -0800
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/ServiceWorker/issues/1810@github.com>
sisidovski created an issue (w3c/ServiceWorker#1810) ACCEPT_CH frame ([draft proposal](https://datatracker.ietf.org/doc/draft-victortan-httpbis-chr-accept-ch-frame/)), which was proposed to provide critical [client hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Client_hints) to the user agent with minimal retry on resource loadings by introducing ACCEPT_CH HTTP/2 or HTTP/3 frames as an optimization. However, even though the retry is minimal compared to [Critical-CH](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Critical-CH), the user agent has to receive some response from the server and need to restart the request with updated headers if there are additional client hints [3.3. Processing ACCEPT_CH Frames](https://datatracker.ietf.org/doc/html/draft-victortan-httpbis-chr-accept-ch-frame-00#section-3.3). This is OK if the website doesn't involve ServiceWorker, but problematic if the ServiceWorker is registered. If the ServiceWorker and fetch handlers are registered, and the server returns ACCEPT_CH frame, the typical loading flow will be following: 1. The browser initiates the resource request. 2. The ServiceWorker intercepts the request, and dispatches fetch event. 3. The fetch handler is executed, which may initiate the network request. 4. The server returns ACCEPT_CH frame. 5. The browser restarts the resource request with updated headers. 6. Repeat 2 and 3. This is observable from developers, and potentially effects the site using ServiceWorker, as fetch handlers are usually not implemented being called multiple times for the same resource. This could double network requests, make analysis inconsistent etc. Not only the fetch event, but also some preload attempts initiated by ServiceWorker may be impacted as well e.g. NavigationPreload, AutoPreload, race-network-and-fetch-handler. Probably it's better to limit the service worker interception only once, but that means the browser will miss the opportunity to send the request with updated headers by ACCEPT_CH frame hints? I feel at least we should discuss and clarify how the ServiceWorker behaves with ACCEPT_CH frame. -- Reply to this email directly or view it on GitHub: https://github.com/w3c/ServiceWorker/issues/1810 You are receiving this because you are subscribed to this thread. Message ID: <w3c/ServiceWorker/issues/1810@github.com>
Received on Monday, 8 December 2025 05:55:34 UTC