gpt4 book ai didi

javascript - IndexedDB 中的最大项目大小

转载 作者:IT王子 更新时间:2023-10-29 03:12:33 25 4
gpt4 key购买 nike

我正在开发一个简单的 Web 实用程序,它使用 HTML5 的 IndexedDB(类似于键值数据库)功能。

我一直在寻找但无法知道:我可以在元素中存储的最大尺寸是多少?

最佳答案

我认为单个项目的大小没有特定限制,只有全局限制。

自本答案最初撰写以来,有关全局限制的规则已发生变化。 up-to-date docs are on MDN - 根据可用磁盘空间,“组”限制(对于给定域,包括其所有子域)范围可以从 10 MB 到 2 GB。


较旧的答案 - 随着 Firefox 38 (2015-05) 的发布而过时,removed dom.indexedDB.warningQuota :

来自 mbrubeck 的回答在 support.mozilla.com(我用永久版本替换了他提供的链接):

By default in Firefox 4, a site can use up to 50MB of IndexedDB storage. If it tries to use more than 50MB, Firefox will ask the user for permission: http://mxr.mozilla.org/mozilla-central/source/modules/libpref/src/init/all.js#101

In Firefox for mobile devices (Google Android and Nokia Maemo), Firefox will ask for permission if a site tries to use more than 5MB: http://mxr.mozilla.org/mozilla-central/source/mobile/app/mobile.js#571[...]

If the user grants permission for a site to exceed the 50 MB IndexedDB quota, then as far as I know Firefox does not impose any more limits. The only limits on the size of the IndexedDB database will be the user's disk space and operating system.

The localStorage quota is 5000KB, and there is no way for a web site to ask the browser for permission to store more than that amount in localStorage.

关于javascript - IndexedDB 中的最大项目大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5692820/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com