Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding API to estimate how much space is taking up for various storage artifacts #10

Closed
kinu opened this issue Jan 21, 2015 · 1 comment

Comments

@kinu
Copy link
Owner

kinu commented Jan 21, 2015

Separated from #6
Related: w3c/ServiceWorker#587

Quota API may not be the right place to add these, but filing this as we've also heard similar requests.

I suppose there could be two flavors:

  • one for estimating size of stored objects (e.g. Cache entry, IDB object store), and
  • one for estimating size of storable objects (e.g. blob, stream, request/response etc)

The former could probably belong to each storage API, while the latter could be also exposed by each object (and some objects already expose the info, e.g. Blob.size). If this is to live in Quota Management API it could probably look like:

Promise<long long> navigator.storageQuota.estimateSize(sequence<(Blob or ArrayBuffer or Stream or Request or Response or ...)> objects);

Also: as is discussed in w3c/ServiceWorker#587 it's not straightforward to estimate on-disk size, because:

  • For some object the size doesn't become available until its content is fully drained
  • The actual on-disk size would depend on the implementation, as it may be de-duped or compressed
@kinu
Copy link
Owner Author

kinu commented Apr 7, 2015

Closing this as it looks it'd be better discussed in each storage API's context (e.g. having cache.size() in Cache API).

@kinu kinu closed this as completed Apr 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant