我尝试在indexedDB中保存大文件,但当我使用大于500MB的文件时,我的chrome停止响应。我的目标是在 indexedDB 中存储 100GB 文件,并将其检索回来并下载相同的文件。
所以基本上我需要使用indexedDB作为大文件存储。
请帮助我实现这一目标。
最佳答案
看起来 IndexedDB 的限制不允许您存储那么多数据。
如果您通读 storage limits看来可以存储的最大数据量是 2 GB。
此处引用的内容如下:
There's also another limit called group limit — this is defined as 20% of the global limit, but it has a minimum of 10 MB and a maximum of 2 GB. Each origin is part of a group (group of origins). There's one group for each eTLD+1 domain. For example:
- mozilla.org — group1, origin1
- www.mozilla.org — group1, origin2
- joe.blogs.mozilla.org — group1, origin3
- firefox.com — group2, origin4
Chrome似乎使用了其他限制,从中您可以找到更多信息here
引用以下信息
Prior to M66, this was 10% of total storage instead of a fixed value on all devices. Now the minimum of a fixed value (2GB) and 10% is used to limit the reserve on devices with plenty of storage, but scale down for devices with extremely limited storage.
关于javascript - 在indexedDB中使用JavaScript保存大文件(> 25 GB),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63729486/