HTML5 sessionStorage limits?

早过忘川 提交于 2020-03-13 07:08:40

问题


A few questions regard HTML5's sessionStorage:

  • Does the 5MB limit on localStorage include sessionStorage? (ie. is it really a 5MB limit on the WebStorage API)
  • If not does sessionStorage have a maximum size limit similar to localStorage?

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:


  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

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".

The above text taken from http://www.html5rocks.com/en/tutorials/offline/storage/



来源:https://stackoverflow.com/questions/11806455/html5-sessionstorage-limits

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!