IndexedDB中的最大项目大小 [英] Maximum item size in IndexedDB

查看:446
本文介绍了IndexedDB中的最大项目大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一个使用HTML5的IndexedDB(类似于键值数据库)的简单Web实用程序。



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

解决方案

来自 mbrubeck


默认情况下,Firefox 4可以使用多达50MB的IndexedDB存储。如果它试图使用超过50MB,Firefox会询问用户的权限: http://mxr.mozilla.org/mozilla-central/source/modules/libpref/init/all.js#101



在针对移动设备的Firefox(Google Android和Nokia Maemo)中,如果某个网站尝试使用超过5MB的内容,Firefox会要求获得许可: http://mxr.mozilla.org/mozilla-central/source/mobile/android/app/mobile.js#571
$ b

[b] [b]

如果用户授予站点权限超过50 MB IndexedDB配额,据我所知,Firefox不会施加任何限制。对IndexedDB数据库大小的唯一限制将是用户的磁盘空间和操作系统。



localStorage配额为5000KB,并且无法访问网站要求浏览器在localStorage中存储超过该数量的权限。


我不认为单个商品的尺寸有一个特定的限制,只有一个全局限制,但您需要来测试。


I'm working on a simple web utility that makes use of IndexedDB (similar to a key-value DB) feature of HTML5.

I was looking for but I was unable to know: what is the maximum size I can store in an item?

解决方案

From an answer by mbrubeck at 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/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/android/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.

I don't think there's a specific limit for a size of a single item, only a global limit, but you'd need to test that.

这篇关于IndexedDB中的最大项目大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆