Re: [ServiceWorker] Pattern for handling fingerprinted assets in cache? (#657)

To clarify the tag idea a bit:

```
// new argument to associate cache-specific info in the entry.  Tag also applies for finding existing
// requests to remove during the put() algorithm.
cache.put(request, response, { tag: 'foo' });

// these do not find entry with 'foo' tag
cache.match(request);
cache.match(request, { tag: 'bar' });

// these do find the entry with 'foo' tag
cache.match(request, { tag: 'foo' });
cache.match(request, { ignoreTag: true });

// finds all entries with 'foo' tag regardless of url
cache.matchAll(null, { tag: 'foo' }));
```

Notably, there is no way to inspect a request or response for the tag.  If content needs that, then it would have to add a header to the response object, etc.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/657#issuecomment-83044771

Received on Wednesday, 18 March 2015 16:26:16 UTC