Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
549 views
in Technique[技术] by (71.8m points)

indexeddb - Storage limits on Chrome browser

What is the soft limit (at which the user needs to give permission to exceed)? What is the hard limit (maximum allowed).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Update May 2020: Chrome now lets an origin use 60% of the storage device's space (Real nitty gritty: "storage device" is the partition containing the chrome profile directory). Updated article here https://web.dev/storage-for-the-web/#how-much


The rule of thumb is 6% (edit 2015-Jul: was 10%) of the available space on the user's hard drive, less if your origin is using websql, appcache or the filesystem api. The MDN doc mentioning 5mb was outdated and has been updated. The gory details about the current policy are here: https://developer.chrome.com/apps/offline_storage

Note some annoying subtleties:

  1. There is no PERSISTENT storage for indexeddb, only the stuff in the link above about TEMPORARY applies.
  2. Once your origin exhausts its share of the pool,indexeddb transactions will unhelpfully abort with no real indication why. As of now the only way to determine that lack of quota is the cause is to use queryUsageAndQuota to check how much space is left. Hopefully a future version of chrome will soon properly fill out IDBTransaction.error in these cases. Edit: chrome 26 now properly fills out IDBTransaction.error with QuotaExceededError.
  3. There is currently no API to request more storage space for indexeddb.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...