The quota size of offline storage in chrome - google-chrome

I have only been using indexedDB for a few day and I have a question about the limit of indexedDB. I have read a lot of documents on the internet and this is what I got:
The quota size of storage
Get the size of storage
Turn the persistent mode on
But I can not find any information about how to change the quota size of storage(at least in chrome).
Can we change the quota size of storage?

Not in Chrome. Quota is determined by a heuristic, sites and users can't alter it.
Your best resource to learn more is probably: https://web.dev/storage-for-the-web/

Related

Is there a way to Increase HTML5 Storage quota

I've been trying and searching for a way to increase the native quota on Safari (both iOS & Desktop), and Chrome, I've tried with no success and searched almost everywhere.
I'm working on a web-app that supposed to work offline most of the time, so at the user's first login, I retrieve the contents and store them within pre-defined databases (using IndexedDB), the problem here is that the app's content may be larger than 30MB.
Is there any way to prompt the user to increase his quota so it fits my app's needs, as long as I understand that there's no way to force a specific quota with out his permission ?
Thanks in advance.
With Chrome (and soon Firefox) you can use APIs to query the quota and how much is used:
From Chrome M61 on (and future Firefox) - spec:
navigator.storage.estimate().then(
(used, total) => console.log(
`using ${used} out of ${total}, or ${used/total*100}%`
)
);
Older Chrome only:
navigator.webkitTemporaryStorage.queryUsageAndQuota(
(used, total) => console.log(
`using ${used} out of ${total}, or ${used/total*100}%`)
);
How much quota an origin is granted by Chrome varies depending on device storage capacity (to balance multiple competing sites and not fill the device). There is no API or prompt to increase storage.
Safari doesn't support the estimate() API yet and likely has different rules/heuristics for granting quota.

Is HTML5 localstorage quota shared?

I'm planning to use the HTML LocalStorage capability of browsers (FF especially) to store data of our intranet application.
I've read about it, how to use, the per domain isolation of data, how the user may increase it's quota, and so on.
But the question is if this quota is shared? Or does each domain has 5Mb to use?
(*) And, if I need to use, say 25Mb, and I ask my clients to increase their browser quota, does that means that all other domains may have this 25MB at disposal?
Or, if another domain uses all of the quota, is there no space left to my app?
UPDATE:
There's a (sub)question related to change browser config to allow more space (*). Althrough the below seems to be a recomendation, does anyone knows if is that implemented on FF?
11.3 Disk space
User agents should limit the total amount of space allowed for storage
areas, because hostile authors could otherwise use this feature to
exhaust the user's available disk space.
User agents should guard against sites storing data under their
origin's other affiliated sites, e.g. storing up to the limit in
a1.example.com, a2.example.com, a3.example.com, etc, circumventing the
main example.com storage limit.
User agents may prompt the user when quotas are reached, allowing the
user to grant a site more space. This enables sites to store many
user-created documents on the user's computer, for instance.
User agents should allow users to see how much space each domain is
using.
A mostly arbitrary limit of five megabytes per origin is suggested.
Implementation feedback is welcome and will be used to update this
suggestion in the future.
For predictability, quotas should be based on the uncompressed size of
data stored.
No, the quota is not shared across domains.
The reason for this is as you said - one domain might use up the browser's entire quota, and leave nothing for other sites.
To see how much storage is provided across different browsers, and to test your own, you can visit http://dev-test.nemikor.com/web-storage/support-test/

IndexedDB storage quota on Chrome

Now that finally Blobs are supported, I am writing a video caching layer to recall N recently downloaded videos.
Is there a way to query IndexedDB for the maximum allowed storage?
Is there a way to request a quota increase?
I am asking because none of the info I found searching seems to apply anymore. I have so far stored hundreds of megabytes of videos although some articles talk of a 5 (or sometimes 20) mb limit. I hope I am not building against a bug.
100+ mb stored so far with no issues using chrome 38.0.2125
I don't think Chrome limit on IndexedDB (or any storage) so far as OS can provide. Also note, IndexedDB storage are temporary storage and can be purged without notifying to the app. When Quota Management API, you will have assurance of persistent storage.

HTML5 sessionStorage limits?

A few questions regard HTML5's sessionStorage:
Does the 5MB limit on localStorage include sessionStorage? (ie. is it really a 5MB limit on the WebStorage API)
If not does sessionStorage have a maximum size limit similar to localStorage?
I found this site http://dev-test.nemikor.com/web-storage/support-test/ in another SO questions, I'm wondering if the data is still relevant?
Does the 5MB limit on localStorage include sessionStorage? (Answer: NO)
is it really a 5MB limit on the WebStorage API (Answer: NO; Supported By )
does sessionStorage have a maximum size limit similar to localStorage? (Answer: NO; Supported By )
Hope I answered all your questions in a simplified manner. Here is a particularly informative section for you:
QUOTAS
You can imagine the chaos if any website was allowed to
populate unsuspecting hard drives with gigabytes of data! Thus,
browsers impose limits on storage capacity. When your app attempts to
exceed that limit, the browser will typically show a dialog to let the
user confirm the increase. You might expect the browser to enforce a
single limit for all storage an origin can use, but the major browsers
are actually enforcing limits separately for each storage mechanism.
This may change in the future, but for now, you should think of the
browser as maintaining a 2-D matrix, with "origin" in one dimension
and "storage" in the other. For example, "http://abc.example.com" is
allowed to store up to 5MB of Web Storage, 25MB of Web SQL Database
Storage, and forbidden to use Indexed Database. Another welcome
enhancement in this area would be user interfaces to let users view
and control how much space they have allocated for each origin. There
are also environments where the user can see upfront how much storage
will be used, e.g. in the case of the Chrome Web Store, when a user
installs an app, they will be prompted upfront to accept its
permissions, which include storage limits. One possible value is
"unlimited_storage".
The above text taken from http://www.html5rocks.com/en/tutorials/offline/storage/

Is there a way in google chrome to allow for more than 4 MB (2 million UTF-16 characters) storage in HTML5 offline storage?

I have created a hosted app for Chrome and I am wondering if there is any way that I can get more than 4 MB offline storage in Chrome.
I have looked at this post http://code.google.com/chrome/webstore/faq.html#faq-app-15 but one says that it is possible to increase Chrome's offline storage by up to ~260MB. Is this really possible? if so, is there any example that illustrates that possibility?
I have also looked at this stackoverflow's post and WebSQL DB appears to not have a limit. so is WebSQL DB or IndexedDB an only option for chrome app to store larger offline contents?
Thank you for your feedback
Take a look at the Quota Management API: http://updates.html5rocks.com/2011/11/Quota-Management-API-Fast-Facts
Or, if you're creating a hosted app, you can use the unlimitedStorage permission to surpass the quota limits: http://code.google.com/chrome/apps/docs/developers_guide.html