Skip to content

Commit e3403ed

Browse files
Fix: Align Cache API definitions with Storage spec (#1789)
* Fix: Align Cache API definitions with Storage spec This commit clarifies how the Cache API interacts with the underlying storage mechanism, resolving ambiguity that stemmed from previous specification language. Key changes: - Removes the direct association between "storage key" and "name to cache map". - Defines "relevant name to cache map" as being retrieved via the `obtain a local storage bottle map` algorithm from the Storage specification, ensuring alignment. - Updates the definition of `CacheStorage` to represent the `name to cache map` associated with its `environment settings object`, rather than the `origin`. - Clarifying the definition of "relevant name to cache map" and its relationship with `CacheStorage`. - Removing the explicit ID and avoiding indirect `[=this=]` usage. - Ensuring consistent syntax for `[=name to cache map=]` references. This makes the relationship between the ServiceWorker Cache API and the Storage specification explicit and consistent, addressing the core issue raised in #1784 and the follow-up work in #1788.
1 parent 3ab2b8a commit e3403ed

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

docs/index.bs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,9 +1952,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
19521952

19531953
A <dfn id="dfn-name-to-cache-map">name to cache map</dfn> is an <a>ordered map</a> whose [=map/entry=] consists of a [=map/key=] (a string that represents the name of a [=request response list=]) and a [=map/value=] (a [=request response list=]).
19541954

1955-
Each [=/storage key=] has an associated [=name to cache map=].
1956-
1957-
The <dfn id="dfn-relevant-name-to-cache-map">relevant name to cache map</dfn> is the [=name to cache map=] associated with the [=/storage key=] [=obtain a storage key|obtained=] from [=this=]'s associated [=CacheStorage/global object=]'s [=environment settings object=].
1955+
The <dfn>relevant name to cache map</dfn> for a {{CacheStorage}} object is the [=name to cache map=] associated with the result of running [=obtain a local storage bottle map=] with the object's associated [=CacheStorage/global object=]'s [=environment settings object=] and "<code>caches</code>".
19581956
</section>
19591957

19601958
<section>
@@ -2262,7 +2260,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
22622260

22632261
The user agent *must* create a {{CacheStorage}} object when a {{Window}} object or a {{WorkerGlobalScope}} object is created and associate it with that <dfn for="CacheStorage">global object</dfn>.
22642262

2265-
A {{CacheStorage}} object represents a <a>name to cache map</a> of its associated [=CacheStorage/global object=]'s <a>environment settings object</a>'s [=environment settings object/origin=]. Multiple separate objects implementing the {{CacheStorage}} interface across documents and workers can all be associated with the same <a>name to cache map</a> simultaneously.
2263+
A {{CacheStorage}} object represents the [=name to cache map=] associated with the result of running [=obtain a local storage bottle map=] with its associated [=CacheStorage/global object=]'s [=environment settings object=] and "<code>caches</code>". Multiple separate objects implementing the {{CacheStorage}} interface across documents and workers can all be associated with the same [=name to cache map=] simultaneously.
22662264

22672265
<section algorithm="cache-storage-match">
22682266
<h4 id="cache-storage-match">{{CacheStorage/match(request, options)}}</h4>

0 commit comments

Comments
 (0)