- From: Arthur Stolyar <notifications@github.com>
- Date: Mon, 18 Apr 2016 07:35:31 -0700
- To: slightlyoff/ServiceWorker <ServiceWorker@noreply.github.com>
Received on Monday, 18 April 2016 14:35:58 UTC
Here is possible polyfill to this problem:
```js
function putAll(cache, entries) {
const operation = entries.map((entry) => {
return cache.put(entry[0], entry[1]);
});
return Promise.all(operation).then(() => {
return cache.put('/__data_is_safe__', new Response(''));
});
}
function hasCache(storage, cacheName) {
return storage.open(cacheName, (cache) => {
return cache.match('/__data_is_safe__')
}).then((response) => {
return !!response;
});
}
```
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/867#issuecomment-211406237
Received on Monday, 18 April 2016 14:35:58 UTC