locked
Confused by shared caching and Caching preview RRS feed

  • Question

  • Caching preview sounds good, and I am trying to use it, but I am confused on how to use it.

    When I had shared caching, I have a dll named Microsoft.ApplicationServer.Caching.Client, the version is 101.0.0.0, and I have the following code in web.config

      <configSections>
        <!-- required to read the <dataCacheClient> element -->
        <section name="dataCacheClient" type="Microsoft.ApplicationServer.Caching.DataCacheClientSection, Microsoft.ApplicationServer.Caching.Core, Culture=neutral, PublicKeyToken=31bf3856ad364e35" allowLocation="true" allowDefinition="Everywhere" />
      </configSections>
      <dataCacheClient>
        <hosts>
          <host name="xxx.cache.windows.net" cachePort="22233" />
        </hosts>

    and  use the following code to access it

            var dataCacheFactory = new DataCacheFactory();
            DataCache dataCache = dataCacheFactory.GetDefaultCache();
            value = (string)dataCache.Get(name);

    Now I have installed the Caching preview, i have several Microsoft.ApplicationServer.Caching dlls, the version if Microsoft.ApplicationServer.Caching.Client is 1.0.0.0

    And seems I need add dataCacheClients config section, which is a pre-defined one.

    Anyone can explain this a bit? are they right? and if it is possible to use both shared caching and caching preview together?

    Monday, October 1, 2012 9:29 PM

Answers

  • Try using the nuget package to get rid of most of the headache that's associated with configuring the cache client.

    On the link Vinushree mentioned, have a look at :

    http://msdn.microsoft.com/en-us/library/windowsazure/hh914160.aspx#BKMK_NuGet

    The 101 versions are for the earlier shared caching and should not be referred to in your new solution which uses the caching preview.

    Thursday, October 4, 2012 7:06 PM

All replies

  • Here is a good article on Migrating from shared cache to caching preview that you can follow.

    http://msdn.microsoft.com/en-us/library/windowsazure/hh914160.aspx

    Referring shared cache dlls and caching preview dlls in the same project is not possible. Can you tell me more about your scenario where you need both shared cache and caching preview.


    Tuesday, October 2, 2012 3:21 AM
  • Try using the nuget package to get rid of most of the headache that's associated with configuring the cache client.

    On the link Vinushree mentioned, have a look at :

    http://msdn.microsoft.com/en-us/library/windowsazure/hh914160.aspx#BKMK_NuGet

    The 101 versions are for the earlier shared caching and should not be referred to in your new solution which uses the caching preview.

    Thursday, October 4, 2012 7:06 PM