How to: Get Started with a Simple Client (Code) (Velocity)
When you programmatically configure your cache client, the configuration settings are passed to the DataCacheFactory class constructor.
Note
For performance reasons, we recommend that you minimize the number of DataCacheFactory objects created in a cache-enabled application. Store the DataCacheFactory object in a variable available to all parts of the application that use cache clients.
The cache client type is defined by the routingClient parameter in the DataCacheFactory class constructor. For a simple client, the routingClient parameter must be false. For more information about the application configuration settings, see Application Configuration Settings (Velocity).
Note
These procedures assume that you have already prepared your development environment and set references to the "Velocity" assemblies, and so on. For more information, see How to: Prepare the Development Environment (Velocity)
To configure a simple client programmatically
Create an array of DataCacheServerEndpoint objects to specify the cache hosts for the client.
Configure your cache hosts by assigning the cache host array from the previous step to the servers parameter of the DataCacheFactory constructor.
Select a simple client type by assigning a false value to the routingClient parameter of the DataCacheFactory constructor.
Configure local cache by assigning a true or false value to the localCache parameter of the DataCacheFactory constructor. Use the true value to enable local cache or a false value to disable local cache.
Use the GetCache method to obtain an instance of the routing client.
Posted in: C# and .NET| Tags: Velocity CTP CTP 3 .NET 4.0 Cache Microsoft Configuration Code client class datacachefactory constructor configure simpleHow to: Get Started with a Routing Client (Code) (Velocity)
When you programmatically configure your cache client, the configuration settings are passed to the DataCacheFactory class constructor.
Note
For performance reasons, we recommend that you minimize the number of DataCacheFactory objects created in a cache-enabled application. Store the DataCacheFactory object in a variable available to all parts of the application that use cache clients.
The cache client type is defined by the routingClient parameter in the DataCacheFactory class constructor. For a routing client, the routingClient parameter must be true. For more information about the application configuration settings, see Application Configuration Settings (Velocity).
Note
These procedures assume that you have already prepared your development environment and set references to the "Velocity" assemblies, and so on. For more information, see How to: Prepare the Development Environment (Velocity)
To configure a routing client programmatically
Create an array of DataCacheServerEndpoint objects to specify the cache hosts for the client.
Configure your cache hosts by assigning the cache host array from the previous step to the servers parameter of the DataCacheFactory constructor.
Select a routing client type by assigning a true value to the routingClient parameter of the DataCacheFactory constructor.
Configure local cache by assigning a true or false value to the localCache parameter of the DataCacheFactory constructor. Use the true value to enable local cache, or a false value to disable local cache.
Use the GetCache method to obtain an instance of the routing client.
Posted in: C# and .NET| Tags: Velocity CTP CTP 3 .NET 4.0 Cache Microsoft Configuration Code client class datacachefactory constructor configure routing