HTML5 sessionStorage限制? [英] HTML5 sessionStorage limits?

查看:519
本文介绍了HTML5 sessionStorage限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关HTML5的sessionStorage的几个问题:

A few questions regard HTML5's sessionStorage:

  • localStorage的5MB限制是否包括sessionStorage? (即,WebStorage API是否真的有5MB的限制)
  • sessionStorage是否具有与localStorage相似的最大大小限制?

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

I found this site http://dev-test.nemikor.com/web-storage/support-test/ in another SO questions, I'm wondering if the data is still relevant?

推荐答案

  1. localStorage的5MB限制是否包括sessionStorage? (答案:)
  2. WebStorage API是否真的有5MB的限制(答案:支持)
  3. sessionStorage是否具有与localStorage相似的最大大小限制? (答案:支持)
  1. Does the 5MB limit on localStorage include sessionStorage? (Answer: NO)
  2. is it really a 5MB limit on the WebStorage API (Answer: NO; Supported By )
  3. does sessionStorage have a maximum size limit similar to localStorage? (Answer: NO; Supported By )

希望我以简化的方式回答了您所有的问题.这是为您提供特别有用的部分:

Hope I answered all your questions in a simplified manner. Here is a particularly informative section for you:

QUOTAS

您可以想象如果任何网站被允许进行混乱 用千兆字节的数据填充毫无戒心的硬盘!因此, 浏览器对存储容量施加了限制.当您的应用尝试 超过该限制,浏览器通常会显示一个对话框,让 用户确认增加.您可能希望浏览器强制执行 原始服务器可以使用的所有存储的单个限制,但是主要浏览器 实际上是针对每种存储机制分别实施限制. 将来这可能会改变,但就目前而言,您应该想到 浏览器保持二维矩阵,一维具有原点" 和存储"中的另一个.例如," http://abc.example.com "是 允许存储多达5MB的Web存储,25MB的Web SQL数据库 存储,禁止使用索引数据库.另一个欢迎 该领域的增强之处在于可以让用户查看的用户界面 并控制他们为每个起点分配了多少空间.那里 在用户可以预先看到多少存储空间的环境中 将被使用,例如如果是Chrome网上应用店,则当用户 安装了一个应用程序,系统会提示他们提前接受该应用程序 权限,其中包括存储限制.一种可能的值是 "unlimited_storage".

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限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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