Re: [ServiceWorker] consider exposing size for cache entries (#587)

Alternatively, if the origin can ensure its server provides accurate content-length headers, then it can simply use those.

```
var length = response.headers.get('content-length');
```

You could then store the total length in IDB.

This would not be exactly the size stored on disk in the cache, though.  The actual size would depend on how the Cache implementation dealt with content encoding, additional compression, de-duplication, etc.  For example, the gecko cache will (unfortunately) remove the content-encoding and then recompress with snappy.

Anyway, maybe the content-length headers are enough and we don't need a new API here.  What do people think?

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

Received on Wednesday, 10 December 2014 23:57:54 UTC