Question

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 -->
Was it helpful?

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.

OTHER TIPS

I found the article in Kentico site, so I posted for others -

Windows Azure Cache Service in Kentico CMS

If you used AppFabric caching in your Kentico CMS projects running on Azure, you could be interested in replacing this caching option with a new Windows Azure Cache because AppFabric cache is no longer provided.

To make it work, you should follow the official guide from Azure documentation - How to Use Windows Azure Cache Service (Preview).

After initially creating the cache and configuring it, you need to open your project in Visual Studio and install Windows Azure Caching NuGet package for CMSApp web role as it is mentioned in the guide.

Another step is to remove xmlns attribute from tag in your web.config file, replace the original and tags with the newly added ones and delete duplicate tag.

The next thing to do is to remove xmlns attribute for tag as well, put tag to the original section and delete the duplicate.

The rest of the steps should correspond to those mentioned in the guide, i.e. replacing [Cache role name or Service Endpoint] with the endpoint, which is displayed on the Dashboard in the Azure Management Portal.

The guide also contains sample codes for creating and retrieving objects from the cache, specifying expiration, storing ASP.NET session state, etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top