开发者

Cached list of data from database in .NET Framework 4

开发者 https://www.devze.com 2023-03-24 21:34 出处:网络
I have an application that uses data from a table which is almost always not changing in many parts of it.

I have an application that uses data from a table which is almost always not changing in many parts of it.

This seems a right place to make a cache of it. So: i need to make cached list of that data to work with it, but have some expiration timeout after which my cached list should update itself from database(thats why global static list is not for this situation).

PS im sure thats not that difficult, but im new to caching and help will save my time, thank you. At least i can create static list that will be updated after some timeout with timer in another thread, but i think such solution i开发者_开发问答s too ugly.


Lots of hints here on how to achieve that:

http://msdn.microsoft.com/en-us/library/dd997357.aspx

Cache can be fitted with an expiry date so it will go and re-fetch the data after a set amount of time without dealing with timers etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消