html 5存储websql和localStorage:数据存储多长时间?
使用新的 Html 5,有 3 种主要方式在浏览器中存储数据:
- localStorage
- WebSQL DB
- 索引数据库
我想知道,对于每种类型,数据存储多长时间? 如果用户第二天输入,数据还会在吗?一个月后?一年?
谢谢
With new Html 5 there are 3 main ways to store data in your browser:
- localStorage
- WebSQL DB
- Indexed DB
I wanted to know, for each of the types, for how long data is stored?
If the user enters the day after, the data will still be there? after one month? and one year?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个问题最正确的答案是:你不知道。
用户可以随时擦除他/她的本地数据,任何类型的本地存储都受用户偏好的影响,并且被认为非常不稳定。但是,根据 Web 存储规范,没有定义过期时间:
来源:http://dev.w3.org/html5/webstorage/
The most correct answer to this question is: You don't know.
The user could wipe his/her local data at any time, and any type of local storage is subject to user preferences and to be considered extremely volatile. However, there is no defined expiration time, according to Web Storage specifications:
Source: http://dev.w3.org/html5/webstorage/
“持久”伴随着 atornblad 指出的警告:只有在用户决定擦除自己的数据之前它才会持久。
'Persistent' comes with the caveat that atornblad pointed out: it's only persistent until the user decides to wipe their own data.