HTML5会话存储限制?

前端之家收集整理的这篇文章主要介绍了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.f2er.com/html5/168759.html

猜你在找的HTML5相关文章