Re: [w3c/ServiceWorker] should prefetch loads trigger FetchEvents? (#1302)

yoshisatoyanagisawa left a comment (w3c/ServiceWorker#1302)

FYI. There is a parallel discussion and implementation for Speculation Rules Prefetch that addresses these concerns. I believe following this approach is the right direction:

- **Client IDs**: In speculation rules prefetch, `clientId` and `resultingClientId` are set to an empty string because a real client does not exist at the time of the fetch—it's essentially a "specification fiction" until the actual navigation/activation occurs. This design also facilitates sharing the prefetch result.
- **Identification**: Instead of relying on client IDs, Service Workers should use the `Sec-Purpose: prefetch` request header to recognize that the initiator is a prefetch.

For more details, you can refer to the following resources:
**Specification**: https://wicg.github.io/nav-speculation/prefetch.html#service-workers-patches
**Explainer**: https://docs.google.com/document/d/192ZLkKcaUE_9Qt8bW9OZLViEEbtxOAgq5WYR87m79IE/edit

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1302#issuecomment-4455756710
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/issues/1302/4455756710@github.com>

Received on Friday, 15 May 2026 00:17:09 UTC