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.)
TEMPORARYstorage can be used without requesting quota, but may be deleted at the browser’s discretion.
PERSISTENTstorage is never deleted without the user’s instruction, but usually requires up-front quota request to use.
TEMPORARYstorage, it is shared between all applications and websites run in the browser.
TEMPORARYstorage has a default quota of 50% of available disk as a shared pool. (50GB => 25GB) (Not restricted to 1GB anymore)
TEMPORARYstorage pool (i.e. 20% of 50% of available disk). (Not restricted to 5Mb anymore)
TEMPORARYstorage quota is exceeded, all the data (incl. AppCache, IndexedDB, WebSQL, File System API) stored for oldest used origin gets deleted .
TEMPORARYstorage quota (20% of pool), an error will be thrown.
queryUsageAndQuota()method of Quota API.
TEMPORARYstorage doesn’t do anything.
webkitRequestFileSystem()doesn’t actually allocate / change quota.
webkitStorageInfo.queryUsageAndQuota( webkitStorageInfo.TEMPORARY, // or PERSISTENT usageCallback, errorCallback);
PERSISTENTstorage, its default quota is 0 and it needs to be explicitly requested per application using
requestQuota()of Quota API.
PERSISTENTtype filesystem) and there’s no such thing like
PERSISTENTstorage on IndexedDB, WebSQL DB or AppCache (yet).
webkitStorageInfo.requestQuota( webkitStorageInfo.PERSISTENT newQuotaInBytes, quotaCallback, errorCallback);
unlimitedStorageon 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.