SALES: 1-800-867-1380

Configure In-Role Cache (Azure Cache)

Updated: September 24, 2014

noteNote
For guidance on choosing the right Azure Cache offering for your application, see Which Azure Cache offering is right for me?.

This topic describes how to configure role-based In-Role Cache. Configuration includes two distinct tasks.

 

Configuration type Description

Role Configuration

Configure a Azure role to host In-Role Cache. This step includes creating named caches and configuring the settings of those named caches. This provides the caching capabilities to any of the roles in the same cloud service deployment.

Client Configuration

Configure any roles that require caching. This includes adding assembly references and settings in the configuration file that point to the role that hosts In-Role Cache.

For more details on caching configuration, see Configuration Model (In-Role Cache for Azure Cache).

Role Configuration

To use role-based In-Role Cache, you must first configure a role to host caching. This could be a new Cache Worker Role that you add to your cloud service, referred to as a dedicated topology. Dedicated role caching is supported on worker roles. For details on configuring a dedicated topology in Visual Studio, see Hosting In-Role Cache on Dedicated Roles (Azure Cache).

Alternatively, you can choose to use an existing role that has available physical resources to share with In-Role Cache. This is referred to as a co-located topology. Co-located role caching is supported on web roles and worker roles. For details on configuring a co-located topology in Visual Studio, see Hosting In-Role Cache on Existing Roles (Azure Cache).

The final step is to create any additional named caches and to configure each cache. For more information, see How To: Configure Azure Caching.

noteNote
Configuring the role in Visual Studio results in configuration changes to the underlying ServiceConfiguration.cscfg and ServiceDefinition.csdef files. For more information, see Configuration Model (In-Role Cache for Azure Cache).

For manual configuration of the ServiceConfiguration.cscfg file, see In-Role Cache Role Configuration Settings (ServiceConfiguration.cscfg).

Client Configuration

Any other code in the cloud service can access the named caches as cache clients. The configuration steps here typically include:

  1. Reference the appropriate caching assemblies.

  2. Add caching configuration settings to application or web.config configuration files.

For examples of the client configuration file settings, see Configuration Model (In-Role Cache for Azure Cache).

noteNote
These steps are simplified by the use of a NuGet package to configure a project to become a cache client. For more information, see How to: Prepare Visual Studio to Use In-Role Cache (Azure Cache).

For manual configuration of the web.config and application.config files, see In-Role Cache Client Configuration Settings (Web.config).

In This Section

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft