子域的HTML5 localStorage大小限制 [英] HTML5 localStorage size limit for subdomains

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

问题描述

HTML5的localStorage数据库通常是大小限制的 - 每个域的标准大小为5或10 MB。这些限制是否可以通过子域来规避(例如,example.com,hack1.example.com和hack2.example.com都有自己的5 MB数据库)?标准中是否有任何内容指定父域是否可以访问其子项的数据库?我找不到任何东西,我可以看到任何一种方式的参数,但似乎必须有一些标准模型。

HTML5's localStorage databases are usually size-limited — standard sizes are 5 or 10 MB per domain. Can these limits be circumvented by subdomains (e.g. example.com, hack1.example.com and hack2.example.com all have their own 5 MB databases)? And is there anything in the standard that specifies whether parent domains can access their children's databases? I can't find anything, and I can see arguments for doing it either way, but it seems like there has to be some standard model.

推荐答案

通过 http://dev.w3.org/html5/webstorage/ #磁盘空间


推荐使用每个源5兆字节的任意限制。我们欢迎实施反馈意见,并将在未来用于更新此建议。

A mostly arbitrary limit of five megabytes per origin is recommended. Implementation feedback is welcome and will be used to update this suggestion in the future.

它还提到:


用户代理应该防止存储数据在
其他附属站点下的数据存储,例如存储最高限额为
a1.example.com,a2.example.com,a3.example.com等,绕过
主要example.com存储限制。

User agents should guard against sites storing data under the origins other affiliated sites, e.g. storing up to the limit in a1.example.com, a2.example.com, a3.example.com, etc, circumventing the main example.com storage limit.

这篇关于子域的HTML5 localStorage大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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