You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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=]).
1954
1954
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>".
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>.
2264
2262
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.
0 commit comments