Search code examples
asp.net.netappfabric

is there anyway to tell the .net cache to use the app fabric server instead of local memory?


We managed to use the App Fabric Caching Server for storing our Outputcache, without changing our code, only with configuration. And it's working very well.

Is there any way to do the same with the .Net Cache (HttpContext.Current.Cache) ? without changing our code, only config.

Thanks


Solution

  • There is no provider abstraction (ProviderBase) for the HttpContext Cache. There is for OutputCache and Session as indicated by @Icarus. It will require changing code.

    Here are a couple ideas for you...

    1. Use AppFabric DataCache instead of HttpContext.Current.Cache. See Hanselmans example.
    2. Convert anything using HttpContext Cache (Application Cache) to Session (User Cache).
    3. See related SO post regarding building a custom Cache provider.