简体   繁体   中英

ASP.NET data caching vs application memory

My ASP.NET application need to use 40K lines of <key, value> pairs.
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? 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. This will automatically invalidate once you change values in table. And store the values in DataSet, and make the key column key in DataSet. This way you can write fast LINQ queries as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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