Caching Shared Search Data - Strategies

Looking at a caching implementation for some common search data in an asp.net web application.

In the past, I created a singleton that creates a bunch of hash tables that have public accessors. This works very well for read-only data that never changes.

I looked at System.Web.Caching a bit, but it does not seem to offer any advantages over the single-user approach. We do not use SQLServer, so we will not be able to use SQLCacheDependency for rare cases when data may change.

Anyone have experience with any of these alternatives? Or is there a better deal?

+3
source share
3 answers

System.Web.Caching , . , / .

, - ( ). , . , . Cache LRU.

, , , .

+3

System.Web.Caching, , , , , . singleton InvalidateCache() , .

- asp.net, , , winforms, System.Web.Caching.

Business Object , NameValueListBase < TKey, TValue > . . , System.Collections.Generic.Dictionary.

-, , CSLA.Net - Expert # 2008. , VB.Net.

+1

I have experience with both. I prefer a singleton pattern for the following reasons:

  • It is not tied to asp.net
  • This allows you to use the search in the bisiness layer for validation or something else.
  • It’s easier to reorganize if the search becomes more complex and you decide not to cache it.
0
source

All Articles