DataCacheFactory Constructor (DataCacheServerEndpoint , Boolean, Boolean)

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Used for configuring a cache client programmatically, based on the parameter values provided.

Namespace: Microsoft.Data.Caching
Assembly: ClientLibrary (in clientlibrary.dll)

Syntax

'Declaration
Public Sub New ( _
    servers As DataCacheServerEndpoint(), _
    routingClient As Boolean, _
    localCache As Boolean _
)
'Usage
Dim servers As DataCacheServerEndpoint()
Dim routingClient As Boolean
Dim localCache As Boolean

Dim instance As New DataCacheFactory(servers, routingClient, localCache)
public DataCacheFactory (
    DataCacheServerEndpoint[] servers,
    bool routingClient,
    bool localCache
)
public:
DataCacheFactory (
    array<DataCacheServerEndpoint^>^ servers, 
    bool routingClient, 
    bool localCache
)
public DataCacheFactory (
    DataCacheServerEndpoint[] servers, 
    boolean routingClient, 
    boolean localCache
)
public function DataCacheFactory (
    servers : DataCacheServerEndpoint[], 
    routingClient : boolean, 
    localCache : boolean
)

Parameters

  • routingClient
    True when the GetCache method returns routing clients; otherwise, it returns simple clients.
  • localCache
    True when local cache is enabled on the cache client; otherwise, local cache is disabled.

Remarks

Before working with the cache, you must instantiate the DataCacheFactory class. When configuration parameters are passed to the DataCacheFactory class constructor, those configuration settings are used for all cache clients obtained from that DataCacheFactory object. Configuration parameters passed to the constructor override settings specified in the application configuration file. For more information about configuration options and settings for the cache client, see Configuration (Velocity).

For the servers parameter, make sure to specify those cache hosts that have been designated lead hosts. Lead hosts are usually the first cache servers installed in the cluster. For more information about lead hosts, see Lead Hosts and Cluster Management (Velocity). You can determine which hosts are lead hosts by using the PowerShell administration tool. For more information about PowerShell, see Cache Administration with PowerShell (Velocity).

For more information about simple clients, routing clients, and local cache, see Cache Clients and Local Cache (Velocity).

See Also

Reference

DataCacheFactory Class
DataCacheFactory Members
Microsoft.Data.Caching Namespace