- From: robrbecker <notifications@github.com>
- Date: Thu, 05 Feb 2015 08:05:44 -0800
- To: slightlyoff/ServiceWorker <ServiceWorker@noreply.github.com>
- Message-ID: <slightlyoff/ServiceWorker/issues/587/73071918@github.com>
tl;dr I'd like to see the ability to query not only the size of individual items in the cache, but also the total size of the cache itself. Hopefully this can be done in a performant way, without having to spin through all the items adding up the size. Each cache could keep a tally on the total size of the items it contains and update it as items are added and removed. Imagine a use case where you might want to take an app offline that deals with displaying large documents. You also want to enable the user to take an entire document offline. The document is comprised of multiple requests, say 1 upfront and 1 per page. When the user clicks to take a document offline, let's say we create a service worker cache for that document, request all the assets and add them to that cache. Now the user has taken a few documents offline. There is a cache per doc, and one for the app assets. The user may want to see what documents are available offline, how much space each uses on their device, and remove a document from the offline cache. If each cache knew the size of the items it contained, then segmenting data into caches in this fashion makes it easy to query the size of a single document. In a use case like this, the user would want to see the space actually consumed on disk, including request overhead and taking into account compression, etc. --- Reply to this email directly or view it on GitHub: https://github.com/slightlyoff/ServiceWorker/issues/587#issuecomment-73071918
Received on Thursday, 5 February 2015 16:06:15 UTC