I have a social network that is growing big, but lots of features are using the 'HttpContex.Current.Cache' class to reutilize the data without the need to go to the data base on every request. I know the 'HttpContext.Current.Cache' is 'static' so I will have problems with multi server and cloud structure. I know that there is a way to configure SQL Server to utilze a cache system as well. Is it enough to handle all the requests or is there something else that I have to do?
By the way, I will have to remove most of the cache features because it hold some user data...
I am asking this kind of question here, because I am testing the Web Site in a multi server structure and I already have problems. I have to make sure Server memory A is equal to Server memory B and doing this, I know am I throwing all the benefits of multi server structure away..
"I have to make sure Server memory A is equal to Server memory B"
I don't think this is achievable in any way.
What you actually want is a Distributed Cache
mechanism. the common options are:
Keep in mind though, that HttpContex.Current.Cache
is static and per App-Domain. it means that once you're switching to a Distributed Cache
solution you'll have to change all calls to HttpContex.Current.Cache
to the new cache API.
The good news are, that at least Session State
and Output Cache
can be easily configured to use the new cache (using web.config
usually).