Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1086381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:48:22+00:00 2026-05-16T22:48:22+00:00

I am using AppFabric as the session state provider in my ASP.Net MVC2 app,

  • 0

I am using AppFabric as the session state provider in my ASP.Net MVC2 app, and I would like it to also use the local cache. I have the following entry in my web.config right after the configSections node:

<dataCacheClient>
    <localCache
         isEnabled="true"
         sync="TimeoutBased"
         objectCount="100000"
         ttlValue="300" />
    <hosts>
        <host name="127.0.0.1" cachePort="22233"/>
    </hosts>
</dataCacheClient>

I also have the following entry in web.config as a child of the system.web node:

<sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider">
    <providers>
        <add name="AppFabricCacheSessionStoreProvider" type="Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider" cacheName="Default" sharedId="DefaultId"/>
    </providers>
</sessionState>

Unfortunately if I add something to session then run the following two commands in the AppFabric powershell, anything I added to my session data is no longer there which leaves me to believe it was not using local cache:

Stop-CacheCluster
Start-CacheCluster

I also try caching objects with AppFabric using the following code and after I start and stop the CacheCluster the once cached object is no longer cached:

var factory = new DataCacheFactory();
var cache = factory.GetCache("Default");
cache.Put("Key", "Test");

However if I instantiate AppFabric using the following code where I explicitly tell it to use local cache rather than relying on the web.config entry it works:

var servers = new List<DataCacheServerEndpoint>(1) { new DataCacheServerEndpoint("127.0.0.1", 22233) };
var configuration = new DataCacheFactoryConfiguration {
                Servers = servers,
                LocalCacheProperties = new DataCacheLocalCacheProperties(100000, new TimeSpan(0, 30, 0), DataCacheLocalCacheInvalidationPolicy.TimeoutBased)
            };
var factory = new DataCacheFactory(configuration);
var cache factory.GetCache("StpWebSession");
cache.Put("Key", "Test");

What am I doing wrong, why doesn’t my web.config entry work in telling AppFabric to use local cache? Can you use AppFabric as your session state provider and also have it use local cache?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:48:22+00:00Added an answer on May 16, 2026 at 10:48 pm

    I found a little ditty at http://social.msdn.microsoft.com/Forums/en-US/velocity/thread/24e72dab-bb20-47ec-aae2-77423b1d296b.

    Basically, “enableSessionState” is “true” by default meaning you need to go remote for all requests. If you set the property to “ReadOnly” the session state object will be retrieved from the Local Cache. Then if local cache is invalidated it will go to remote store again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have configured the Azure AppFabric Cache as session provider in my ASP.NET MVC
I would like to know the version of ASP.NET supports using Windows AppFabric caching
Is there a way in .Net to switch out the Cache provider just like
Can anyone tell me that if I use Session(inside an ASP.NET MVC 3 application)
Using ASP.NET MVC there are situations (such as form submission) that may require a
Is anybody using Windows AppFabric Server for out of process state management? Any feedback,
I am new to using AppFabric to host WF services. I am trying to
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.