现代浏览器为用户系统当地储存数据提供网络信息预报器,其容量至少为5个用户,数据从来不像厨师那样转给服务器。
WebStorage API provides two object for storing data on the client:
- window.localStorage - stores data with no expiration date
- window.sessionStorage - stores data for one session (data is lost when the browser tab is closed)
https://www.w3schools.com/html/html5_webstorage.asp
https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
Modern browsers also provide IndexedDB API to storage of significant amounts of structured data on client system.
This API uses indexes to enable high-performance searches of this data. While Web Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data.
https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
WebStorage API store and retrieve data as synchronize which means make main threat of web page blocked until data stored or retrieved.
But operations performed using IndexedDB are done asynchronously, so as not to block applications.