Is it support Application cache in multiple server in asp.net(C#). I know application variable is not supporting in multiple server (web farms), But what about application cache? .Will be there any issue whiling access the values or it not worth to store values in application cache when we are going with multiple server? (Database storing not suitable, it will take more load). Here i am using codes
HybridDictionary dicApplicationVariable = new HybridDictionary();
if (HttpContext.Current.Cache["dicApplicationVariable"] != null)
{
dicApplicationVariable = (HybridDictionary)HttpContext.Current.Cache["dicApplicationVariable"];
if (dicApplicationVariable.Contains(dtUserLogin.Rows[0]["Id"]))
{
dicApplicationVariable.Remove(dtUserLogin.Rows[0]["Id"]);
dicApplicationVariable.Add(dtUserLogin.Rows[0]["Id"], LogginSessionID);
}
else
{
dicApplicationVariable.Add(dtUserLogin.Rows[0]["Id"], LogginSessionID);
}
}
else
{
dicApplicationVariable.Add(dtUserLogin.Rows[0]["Id"], LogginSessionID);
HttpContext.Current.Cache["dicApplicationVariable"] = dicApplicationVariable;
}
If you are running Windows Server 2008 or later, then I would look into Windows Server AppFabric Caching.
Windows Server AppFabric extends Windows Server to provide enhanced hosting, management, and caching capabilities for Web applications and middle-tier services. The AppFabric hosting features add service management extensions to Internet Information Services (IIS), Windows Process Activation Service (WAS), and the .NET Framework 4. This includes Hosting Services and Hosting Administration tools that make it easier to deploy, configure, and manage Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) based services. The AppFabric caching features add a distributed, in-memory object cache to Windows Server that makes it easier to scale out high-performance .NET applications, especially ASP.NET applications.
I realize that not everyone will want to use Microsoft products, so here are some alternatives to AppFabric:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With