在ASP.NET应用程序缓存中存储只读数据 [英] Storing Read-Only Data in ASP.NET Application Cache

查看:112
本文介绍了在ASP.NET应用程序缓存中存储只读数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我似乎不想让我在这里的成员为我做设计工作,但是我有一个与设计有关的问题,如果不编写大量代码并做一些漂亮的事情,我将无法思考如何进行评估详细测试.因此,我想知道我是否可以将基本思想带给过去的开发人员,这些开发人员比我有更多的经验,并且可以简单地给我快速的是/否,无论我是在正确的道路上还是在错误的树上吠叫.

我有少量(<100条记录)的数据完全是只读的.但是,该站点的用户可以使用搜索过滤器来形成他们自己的数据视图.因此,我当时正在考虑将实际的DataSet存储在应用程序缓存中,并让每个用户根据需要构建一个DataView.

由于数据是只读的,并且记录很少,因此我打算在从DataSet构建DataView时不加锁定地执行此操作.我认为这应该没事吗?

(注意:我预计该网站最初将只有少数几个同时用户,但显然我不希望如果我有100个用户,那么整个事情就不会发生.)

对于基本设计的任何其他评论将不胜感激.

帕特里克

Hi,

I don''t wish to seem that I am asking members on here to do my design work for me but I have a design-related question that I can''t think how to evaluate without writing a load of code and doing some pretty detailed testing. I therefore wondered if I could run the basic idea past developers on here who have had a lot more experience than me and may simply be able to give me a quick yes/no whether I am on the right track or barking up the wrong tree.

I have a small quantity (<100 records) of data that is completely read-only. Users of the site can however form their own views of the data using search filters. I was therefore thinking of storing the actual DataSet in the Application cache and having each user build a DataView as needed.

Since the data is read-only and there are so few records, I was intending to do this with no locking when the DataViews are being built from the DataSet. Am I right in thinking that this should be fine?

(Note: I envisage the site will have no more than a handful of simultaneous users initially, but I obviously don''t want the whole thing to fall over if I got, say, 100.)

Any other comments on the basic design would be very much appreciated.

Kind wishes, Patrick

推荐答案

一个好消息,DataSet是一个非常重"的对象,通常不被缓存.除非您在数据集中有多个数据表,否则没有理由使用它.创建实体对象或POCO可能会更有效.
A DataSet is a pretty "heavy" object and is not usually cached. Unless you have multiple DataTables within the DataSet there is no reason to use it. Creating an entity object or POCO may be a more efficient.


这篇关于在ASP.NET应用程序缓存中存储只读数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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