Re: [w3c/ServiceWorker] Allow caches to opt-in to granular cleanup (#863)

And what about explicitly marking them for disposal? What if we provide a general disposal queue and the developer can simply mark a response as disposable:

```js
let response = await Caches.match(request);
if (response) {
  handle(response);
  response.isDisposable(true); // adds to the disposal queue
}
```

It gives control over semantics to the developer. We can provide extra parameters to common methods to ease batch operations:

```js
let keys = await cache.keys(request, { disposable: true });
keys[keys.length - 1].isDisposable(false); // all matches are disposable except the last one
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/863#issuecomment-353027923

Received on Wednesday, 20 December 2017 10:37:58 UTC