Search code examples
c#asp.netazurekenticoazure-caching

How to configure Kentico CMS to use In-Role Cache


First of all, I'm new to Kentico CMS.

We download the from here. Then install the application as Windows Azure project.

When I look at web.config, Kentico CMS 7 (as of today) uses Shared Caching which has been deprecated a couple of years back.

Is there any way I can configure to use In-Role Cache (or worst case Cache Service which is still in Preview)?

<!-- Azure AppFabric cache BEGIN -->
<section name="dataCacheClients" 
   type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, 
       Microsoft.ApplicationServer.Caching.Core" allowLocation="true" 
   allowDefinition="Everywhere"/>
<!-- Azure AppFabric cache END -->

<!-- Azure AppFabric cache BEGIN -->
<dataCacheClients>
  <dataCacheClient name="default">
    <hosts>
      <host name="YourName.cache.windows.net" cachePort="22233"/>
    </hosts>
    <securityProperties mode="Message">
      <messageSecurity authorizationInfo="YourKey"/>
    </securityProperties>
  </dataCacheClient>
  <dataCacheClient name="SslEndpoint">
    <hosts>
      <host name="YourName.cache.windows.net" cachePort="22243"/>
    </hosts>
    <securityProperties mode="Message" sslEnabled="true">
      <messageSecurity authorizationInfo="YourKey"/>
    </securityProperties>
  </dataCacheClient>
</dataCacheClients>
<!-- Azure AppFabric cache END -->

Solution

  • The host element in the caching configuration points to a caching cluster and it doesn't care about how the cache cluster is deployed - old service, new service or in-role.

    If you use the new Caching service you should be able to change the configuration to point at your cache instance using your cache's URL

    To use in-role caching you will need to create the relevant load-balanced endpoints for the cloud service and then configure your client with your cloud service URL.