[slightlyoff/ServiceWorker] `caches.match` search order (#862)

`caches.match` currently searches for files in insertion order. This behaviour makes it impossible to search for the latest files in the entire Cache Storage. For example:
```
Promise.all([
  caches.open('v0.1.0').then(cache => cache.put('/a/b.txt',new Response('1'))),
  caches.open('v0.1.2').then(cache => cache.put('/a/b.txt',new Response('2')))
]).then(() => {
  caches.match('/a/b.txt').then(response => {
    response.text().then(text => console.log(text)); //1, it should be 2 instead.
  });
});
```

---
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/862

Received on Thursday, 31 March 2016 14:40:31 UTC