简体   繁体   English

如何在Angular 4上的浏览器本地存储中处理大量数据?

[英]How to handle large amount of data in browsers local storage on Angular 4?

I have developing one web app in Angular 4. That has returning the 50k+ records from API. 我在Angular 4中开发了一个Web应用程序。它已经从API返回了50k +记录。 With that I need to store that data in to local storage and handle offline once data return. 有了这个,我需要将数据存储到本地存储,并在数据返回后处理脱机。 I tried with localstoarge but localstoarge not storing all data. 我尝试使用localstoarge但localstoarge没有存储所有数据。 Because it have maximum limit 5MB and it will change based on browser. 因为它有最大限制5MB,它会根据浏览器而改变。 Suggestion any idea? 建议任何想法?

Thanks, 谢谢,

Use IndexedDB instead - it has a much greater size limit, and is perfectly suited for organizing large amounts of structured data. 使用IndexedDB - 它具有更大的大小限制,非常适合组织大量结构化数据。 It's significantly more tricky to use than localStorage, but it's your only other option if you want to store data too large for localStorage. 使用它比localStorage更加棘手,但如果你想为localStorage存储太大的数据,那么它是你唯一的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM