There’s various offline related features introduced to modern browsers through HTML5. While offline is convenient, its concept of quota has been left untouched for a long time. The latest version of Chrome browser has the first concept and its implementation of Quota Management API . It handles quota for AppCache, IndexedDB, WebSQL and File System API. Here’s a list of things you should keep in mind when working with Quota Management API in the latest Chrome.
(The specific numbers and details noted below are not a part of HTML5 but the facts in the current Chrome implementation. The API and Quota management in Chrome is still evolving and the details may change over the time.)
TEMPORARY storage and PERSISTENT storage.
TEMPORARY storage can be used without requesting quota, but may be deleted at the browser’s discretion.PERSISTENT storage is never deleted without the user’s instruction, but usually requires up-front quota request to use.TEMPORARY storage, it is shared between all applications and websites run in the browser.
TEMPORARY storage has a default quota of 50% of available disk as a shared pool. (50GB => 25GB) (Not restricted to 1GB anymore)TEMPORARY storage pool (i.e. 20% of 50% of available disk). (Not restricted to 5Mb anymore)TEMPORARY storage quota is exceeded, all the data (incl. AppCache, IndexedDB, WebSQL, File System API) stored for oldest used origin gets deleted .TEMPORARY storage quota (20% of pool), an error will be thrown.queryUsageAndQuota() method of Quota API.TEMPORARY storage doesn’t do anything.TEMPORARY storage using webkitRequestFileSystem() doesn’t actually allocate / change quota.
webkitStorageInfo.queryUsageAndQuota(
webkitStorageInfo.TEMPORARY, // or PERSISTENT
usageCallback,
errorCallback);PERSISTENT storage, its default quota is 0 and it needs to be explicitly requested per application using requestQuota() of Quota API.
PERSISTENT type filesystem) and there’s no such thing like PERSISTENT storage on IndexedDB, WebSQL DB or AppCache (yet).
webkitStorageInfo.requestQuota(
webkitStorageInfo.PERSISTENT
newQuotaInBytes,
quotaCallback,
errorCallback);unlimitedStorage on manifest.json of Chrome Web App has been brought as a temporary solution for apps to work without Quota API. So, there’s no guarantee that Chrome will support this feature forever.⟪ WebGL demo roundup "Stream" video using the MediaSource API ⟫