是否有限制多少数据,我应该在浏览器内存中缓存? [英] Is there a limit to how much data I should cache in browser memory?

查看:448
本文介绍了是否有限制多少数据,我应该在浏览器内存中缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从一个REST服务加载一对夫妇一千记录用户数据(用户联系人的联系人管理系统,为precise)并在其上运行SEACH。不幸的是,REST服务不提供搜索这符合我的需要,所以我减少到只有加载大量的数据,并通过它自己的搜索。加载记录是耗时的,所以我只想做一次,为每个用户。

I need to load a couple thousand records of user data (user contacts in a contact-management system, to be precise) from a REST service and run a seach on them. Unfortunately, the REST service doesn't offer a search which meets my needs, so I'm reduced to just loading a bunch of data and searching through it myself. Loading the records is time-consuming, so I only want to do it once for each user.

显然需要此数据被缓存。不幸的是,服务器侧高速缓存不是一个选项。我的客户端运行在多个服务器上的应用程序,而且也没有办法predict哪个服务器给定的请求将降落在。

Obviously this data needs to be cached. Unfortunately, server-side caching is not an option. My client runs apps on multiple servers, and there's no way to predict which server a given request will land on.

所以,接下来的选择就是缓存此数据在浏览器端,并在其上​​运行的搜索那里。对有上千个联系人的用户,这可能意味着缓存数据的几个兆。也许我可以运行在哪些问题中存储的JavaScript数据的几个兆在浏览器内存?

So, the next option is to cache this data on the browser side and run searches on it there. For a user with thousands of contacts, this could mean caching several megs of data. What problems might I run in to storing several megs of javascript data in browser memory?

推荐答案

存储数据的Javascript数兆应当引起任何问题。内存泄漏会。想想看,现代计算机有多少RAM - 几兆是在众所周知的杯水车薪分子

Storing several megs of Javascript data should cause no problems. Memory leaks will. Think about how much RAM modern computers have - a few megabytes is a molecule in the drop in the proverbial bucket.

这篇关于是否有限制多少数据,我应该在浏览器内存中缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆