- From: Monica Chintala <notifications@github.com>
- Date: Tue, 04 Aug 2026 14:16:38 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/ServiceWorker/pull/1843@github.com>
Closes #1841. Follow-up to #1755, sibling to #1838.
Give each [=request response list=] (the internal representation of a {{Cache}} object) a dedicated parallel queue and route the {{Cache}} methods that read or mutate it through the queue, so reads and writes on the same {{Cache}} object are serialized.
## Changes
- Add `<dfn>request response list parallel queue</dfn>` (a [=parallel queue=]) attached to each [=request response list=], following the same pattern that #1838 introduced for the [=name to cache map=].
- Route the following {{Cache}} method algorithms through it, replacing their existing `Run … in parallel` block:
- {{Cache/matchAll(request, options)}}
- {{Cache/addAll(requests)}} — only the batch-commit step; the per-request fetch step is left as bare `in parallel` since it does not touch the [=request response list=].
- {{Cache/put(request, response)}}
- {{Cache/delete(request, options)}}
- {{Cache/keys(request, options)}}
- The existing `Queue a task` wrappers around promise resolution / rejection (from #1837) are preserved inside the enqueued steps.
Total change: **+7 / −5** in `index.bs`, one commit.
## Out of scope (deliberately)
- {{Cache/match(request, options)}} — a pure orchestrator that delegates to `matchAll`; enqueueing it too would cause a deadlock (it waits on a promise that can only be settled by another enqueued step). Covered transitively.
- {{Cache/add(request)}} — pure orchestrator that delegates to `addAll`. Same reason.
- {{Cache/addAll}}'s per-request fetch block — only performs [=/fetching=]; does not touch the [=request response list=].
## Rationale
Yoshi flagged this concern during #1755 review:
> The situation should also be the same for the [=cache=] object. I guess each [=cache=] object will have the dedicated parallel queue, and `match()`, `matchAll()`, `add()`, `addAll()`, `put()`, `delete()`, and `keys()` might also executed within the parallel queue for the [=cache=] object.
#1837 landed the queue-a-task-for-resolve fixes for these methods. This PR delivers the sibling per-cache parallel-queue work that was explicitly deferred in the [split plan](https://github.com/w3c/ServiceWorker/pull/1755#issuecomment-4963401716).
## Coordination
The changes here do not overlap textually with the queue-a-task changes in #1837 — that PR only touches the promise resolve/reject lines, this PR only touches the outer `Run in parallel` lines. Either can merge first.
## Related
- #1755 — parent (queue-a-task refactor)
- #1837 — Cache API queue-a-task-for-resolve (open)
- #1838 — sibling PR (CacheStorage `name to cache map` parallel queue), same dfn pattern
- #1740 — original missing-tasks-in-parallel issue
- #1831 — cache/cache-storage forgot to queue a task to resolve promise
- #1172 — umbrella "Carefully audit all uses of 'in parallel' in the spec"
- #1842 — sibling PR (Clients API parallel queue), same dfn pattern
<!--
This comment and the below content is programmatically generated.
You may add a comma-separated list of anchors you'd like a
direct link to below (e.g. #idl-serializers, #idl-sequence):
Don't remove this comment or modify anything below this line.
If you don't want a preview generated for this pull request,
just replace the whole of this comment's content by "no preview"
and remove what's below.
-->
***
<a href="https://pr-preview.s3.amazonaws.com/monica-ch/ServiceWorker/pull/1843.html" title="Last updated on Aug 4, 2026, 9:16 PM UTC (09f4f7a)">Preview</a> | <a href="https://pr-preview.s3.amazonaws.com/w3c/ServiceWorker/1843/e91ddff...monica-ch:09f4f7a.html" title="Last updated on Aug 4, 2026, 9:16 PM UTC (09f4f7a)">Diff</a>
You can view, comment on, or merge this pull request online at:
https://github.com/w3c/ServiceWorker/pull/1843
-- Commit Summary --
* Editorial: use a per-cache dedicated parallel queue for Cache API methods
-- File Changes --
M index.bs (12)
-- Patch Links --
https://github.com/w3c/ServiceWorker/pull/1843.patch
https://github.com/w3c/ServiceWorker/pull/1843.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1843
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/ServiceWorker/pull/1843@github.com>
Received on Tuesday, 4 August 2026 21:16:42 UTC