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

The only criticism I have is that this needs to go through the cache to work, my instinct is that I'd get a response, figure out it's size and then check what the current fill of the cache is in terms of file size and make a decision to include or not.

- This allows decisions per file basis (i.e. this file is huge, don't ever cache it)
- This file is good to cache, do I have enough space?
- This file is fresh, is there a big file I should drop from the cache for this response and possibly others?

But this all sounds like it would live on the request rather than the cache API and would shift the onus onto the developer to track memory usage (which is good and bad).

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

Received on Wednesday, 10 December 2014 22:25:17 UTC