localStorage Size Limits… What are the options?

走远了吗. 提交于 2019-12-18 08:26:20

问题


I plan to use persistant localStorage in one of my projects and i have found out that the size limitation is 5 MB (chrome). I searched other frameworks which implmented the same thing, like Mootools, Dojo, Lawnchair but i couldnt find out what are their size limitations.

Does anyone know what are the size limitation is in these. And what other options are there which i can use if not the one already stated above.


回答1:


localstorage limits are not tied to the javascript framework, but to the browser you're using. Currently specs are suggesting to limit the storage space to 5MB and this is the space maximum available on modern browser

On older versions of internet explorer (IE<8) userData behaviour (which mimics the localstorage) has a limit of 128kb for page (512kb is the maximum amount for an intranet page)

anyway for a complete list see http://dev-test.nemikor.com/web-storage/support-test/




回答2:


you can use IndexedDB, but it's not supported by all browser, but it can be unlimited if user accept.




回答3:


If you store JSON into your localStorage you can save space using a compression tool, like : https://github.com/k-yak/JJLC



来源:https://stackoverflow.com/questions/9283595/localstorage-size-limits-what-are-the-options

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