Tuesday, May 13, 2014

ASP.NET Azure Session State in Azure

ASP.NET Azure Session State in Azure

In addition to the data caching, we can also use Windows Azure Caching as the storage mechanism for ASP.NET Session State and ASP.NET Page Output Caching. The Session State Provider for Windows Azure Caching and the Output Cache Provider for Windows Azure Caching are the out-of-process storage for ASP.NET applications which will greatly work with Windows Azure load balancers. To use Windows Azure Caching as the storage mechanism for ASP.NET Session State and ASP.NET Page Output Caching, first you need to configure Cache Cluster (using one of the two approaches explained above) and then you need to configure your ASP.NET application to use the Windows Azure Caching. After you have configured the Cache Cluster, you can use Windows Azure Caching for ASP.NET Session State and ASP.NET Page Output Caching by adding necessary configuration setting in the web.config file.
The following configuration setting in the web.config allows to use the Session State Provider for Windows Azure Caching for web applications.

  
              type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache"
          cacheName="default"
          useBlobMode="true"
          dataCacheClientName="default" />
  
The cacheName specifies the name of the Cache used for persisting Session State data.
The following configuration setting in the web.config configures the Session State Provider for Windows Azure Caching for web applications

  
    
                     type="Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider, Microsoft.Web.DistributedCache"
            cacheName="default"
            dataCacheClientName="default" />
    

  

No comments:

Post a Comment