微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

HTML5会话存储限制?

HTML5的sessionStorage有几个问题:

> localStorage的5MB限制是否包含sessionStorage? (即WebStorage API真的是5MB的限制)
>如果sessionStorage不具有类似于localStorage的最大大小限制?

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

解决方法

> localStorage的5MB限制是否包含sessionStorage? (答:NO; Supported by)
> WebStorage API真的是一个5MB的限制(答案:NO; Supported By)
> sessionStorage是否具有类似于localStorage的最大大小限制? (答:NO; 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,“07003” 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/

原文地址:https://www.jb51.cc/html5/168759.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。