caches
.has("v1")
.then((hasCache) => {
if (!hasCache) {
someCacheSetupFunction();
} else {
caches.open("v1").then((cache) => cache.addAll(myAssets));
}
})
.catch(() => {
// Handle exception here.
});CacheStorage: has() method / notebook
CacheStorage: has() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.