denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
94.04k stars 5.23k forks source link

Implement quota management and StorageManager API #11525

Open kitsonk opened 3 years ago

kitsonk commented 3 years ago

With local storage, blob storage, but also with the likes of IndexedDB and CacheStorage, and potentially the DENO_DIR, we need a more mature centralised location to do quota management for objects we persist to disk. All browsers implement some form of quota management.

How Mozilla/Firefox deals with it is discussed here: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria

Chromium is discussed here: https://web.dev/storage-for-the-web/

Chromium and Firefox implement that StorageManager API.

The storage manager API though requires an origin, and that gets into the debate of the "origin-less" usage of Deno.

tom-sherman commented 1 year ago

@kitsonk is it safe to say that the "origin debate" is now settled with things like CacheStorage using the rules described in the following link? https://github.com/denoland/deno/issues/11882#issuecomment-951609819