gpt4 book ai didi

javascript - Edge/Safari 是否对 Indexeddb 大小有限制?

转载 作者:数据小太阳 更新时间:2023-10-29 06:04:34 26 4
gpt4 key购买 nike

目前正在研究各种浏览器的 indexeddb 限制。发现 Chrome 没有硬性限制,但需要授予权限 ( Source ),Firefox 是本地存储的 50%( Source ) 但找不到适用于 Edge 或 Safari 的任何内容。

我试验了 Edge,发现它没有 IE 设置的限制:每个域 500MB ( Source )

不幸的是 navigator.storage.estimate() 在 Edge 上不起作用 https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/estimate

有没有人有这方面的 Edge 或 Safari 经验?

最佳答案

Microsoft Edge 的 IndexedDB 限制是全局最大值的 20%,类似于 Firefox 和 Chrome:

It depends on the device and which version of Edge you're using. The latest version is similar (sic) to Chrome/FF and have the following limits per domain - each domain can take up to 20% of the global limit (which is for all domains):

IndexedDB Size Table

Source: https://twitter.com/gregwhitworth/status/1020391736974094336

因此,每个域的数据库可以增长多大取决于您的硬盘驱动器卷大小。


Safari 的 IndexedDB 限制对于桌面是无限的,根据:https://developers.google.com/web/fundamentals/instant-and-offline/web-storage/offline-for-pwa

In mobile Safari, apps can use up to 50MB max, whereas desktop Safari allows unlimited storage (and prompts after 5MB)

但是,Safari 在 2018 年 11 月首次跟踪时实现了新的 IndexedDB 限制:

If the size of free disk space is over 1 GB, the default limit is 500 MB; otherwise it is half the free disk space. - WebKit change tracker

关于javascript - Edge/Safari 是否对 Indexeddb 大小有限制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51405660/

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