gpt4 book ai didi

HTML5 sessionStorage 限制?

转载 作者:技术小花猫 更新时间:2023-10-29 12:20:18 26 4
gpt4 key购买 nike

关于 HTML5 的 sessionStorage 的几个问题:

  • localStorage 的 5MB 限制是否包括 sessionStorage? (即 WebStorage API 真的有 5MB 的限制吗)
  • 如果没有,sessionStorage 是否有类似于 localStorage 的最大大小限制?

我找到了这个网站 http://dev-test.nemikor.com/web-storage/support-test/在另一个 SO 问题中,我想知道数据是否仍然相关?

最佳答案

  1. localStorage 的 5MB 限制是否包括 sessionStorage? (答案:)
  2. WebStorage API 真的有 5MB 的限制吗(答案:Supported By)
  3. sessionStorage 是否有与 localStorage 类似的最大大小限制? (答案:Supported By)

希望我以简单的方式回答了您的所有问题。这是一个特别有用的部分:

QUOTAS

You can imagine the chaos if any website was allowed to populate unsuspecting hard drives with gigabytes of data! Thus, browsers impose limits on storage capacity. When your app attempts to exceed that limit, the browser will typically show a dialog to let the user confirm the increase. You might expect the browser to enforce a single limit for all storage an origin can use, but the major browsers are actually enforcing limits separately for each storage mechanism. This may change in the future, but for now, you should think of the browser as maintaining a 2-D matrix, with "origin" in one dimension and "storage" in the other. For example, "http://abc.example.com" is allowed to store up to 5MB of Web Storage, 25MB of Web SQL Database Storage, and forbidden to use Indexed Database. Another welcome enhancement in this area would be user interfaces to let users view and control how much space they have allocated for each origin. There are also environments where the user can see upfront how much storage will be used, e.g. in the case of the Chrome Web Store, when a user installs an app, they will be prompted upfront to accept its permissions, which include storage limits. One possible value is "unlimited_storage".

以上文字摘自http://www.html5rocks.com/en/tutorials/offline/storage/

关于HTML5 sessionStorage 限制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11806455/

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