This feature is not Baseline because it does not work in some of the most widely-used browsers.
The caches property of the StorageAccessHandle interface returns an unpartitioned CacheStorage object if access was granted, and throws a SecurityError DOMException otherwise.
A CacheStorage object.
document.requestStorageAccess({ caches: true }).then(
(handle) => {
console.log("caches access granted");
const cache = await handle.caches.open("foo");
await cache.add("/");
},
() => {
console.log("caches access denied");
},
);
Note: See Using the Storage Access API for a more complete example.
| Specification |
|---|
| Extending Storage Access API (SAA) to non-cookie storage> # dom-storageaccesshandle-caches> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
caches |
125 | No | No | 111 | No | 125 | No | 83 | No | 27.0 | No | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/StorageAccessHandle/caches