简体   繁体   English

ASP.NET数据缓存与应用程序内存

[英]ASP.NET data caching vs application memory

My ASP.NET application need to use 40K lines of <key, value> pairs. 我的ASP.NET应用程序需要使用40K行的<key, value>对。
with every client request, the application search the right key and return the proper value. 对于每个客户请求,应用程序都会搜索正确的密钥并返回正确的值。

should I just use a Dictionary<string, string> or use ASP.NET caching solution? 我应该只使用Dictionary<string, string>还是使用ASP.NET缓存解决方案? what is the benefit for each solution? 每种解决方案的好处是什么?

edit: 编辑:

  • the lifetime of the data is the lifetime of the application. 数据的生存期就是应用程序的生存期。
  • it would be updated manually every couple of weeks. 它将每两周进行手动更新。
  • it shared between all users 它在所有用户之间共享
  • no write operation, only reads 无写入操作,仅读取

I would suggest use ASP.NET dependacy caching if you are using SQL server. 如果您使用的是SQL Server,建议使用ASP.NET依赖缓存。 This will automatically invalidate once you change values in table. 一旦更改表中的值,这将自动失效。 And store the values in DataSet, and make the key column key in DataSet. 并将这些值存储在DataSet中,并在DataSet中创建键列键。 This way you can write fast LINQ queries as well. 这样,您也可以编写快速的LINQ查询。

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

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