Skip to content
ironyx edited this page Dec 30, 2014 · 14 revisions

Getting started quickly involves standing up the Dache Client and a Dache Host for the client to communicate with.

Client

The Dache Client is a single DLL which you reference in any application which you would like to use Dache with. You have 2 options for installing the Dache Client:

NuGet Client

Install the Dache Client via NuGet. Your web.config or app.config will be automatically modified to include the default Dache client configuration:

<configuration>
  <configSections>
    <section name="cacheClientSettings"
      type="Dache.Client.Configuration.CacheClientConfigurationSection, Dache.Client"/>
  </configSections>
  <cacheClientSettings>
    <cacheHosts>
      <add address="localhost" port="33333" />
    </cacheHosts>
  </cacheClientSettings>
</configuration>

Next, instantiate the CacheClient:

// Using the settings from app.config or web.config
var cacheClient = new Dache.Client.CacheClient();

or

// Using programmatically created settings
var settings = new CacheClientConfigurationSettings { ... };
var cacheClient = new Dache.Client.CacheClient(settings);

A file called CacheProvider.cs will also be installed at the root of your project. It is a working example of using the CacheClient and is intended for experimentation and getting a quick-start with Dache. You can build on top of this implementation or discard it completely. The purpose of it is to show you how to use the Dache client in your code.

Manual DLL Reference

To install the Dache Client manually, first download the binaries from http://www.dache.io/download and then copy the files located in the Client folder to your solution's folder structure. Then, add a reference to Dache.Client.dll to your project.

Next, instantiate the CacheClient as demonstrated above. You'll also need to include the configuration above in your app.config or web.config file.

Client Notes And Next Steps

CacheClient is intended to be used as a singleton. Do not create a new CacheClient per request.

IMPORTANT: all clients should be configured with the same list of servers. The list of servers does not have to be in the same order, but each client's list should contain the same servers.

To learn more about using Dache, check out the other pages of this wiki.

Host

The host is the actual process that does the caching work. You have 3 options for hosting Dache:

Quick And Easy Console Host

To use the console host, first download the latest release and then run (or double click) CacheHost/Dache.CacheHost.exe. A console will open that verifies the Dache settings and then gives you information about Dache as it is used.

Windows Service

To install and use the provided Windows service, first download the binaries from http://www.dache.io/download and then run CacheHost/install.bat. You will be offered custom installation settings, including the ability to rename the service if you want to install multiple Dache hosts on a single server under unique names.

After successful installation, you can run the service from Windows Services.

To uninstall Dache, run CacheHost/uninstall.bat.

Host In Your Own Process

To host Dache in your own process, install the Dache Host via NuGet. Your web.config or app.config will be automatically modified to include the default Dache host configuration:

<configuration>
  <configSections>
    <section name="cacheHostSettings"
      type="Dache.CacheHost.Configuration.CacheHostConfigurationSection, Dache.CacheHost"
      allowExeDefinition="MachineToApplication" />
  </configSections>
  <cacheHostSettings port="33333" />
</configuration>

Next, instantiate the CacheHostEngine:

// Using the settings from app.config or web.config
var cacheHost = new Dache.CacheHost.CacheHostEngine();

or

// Using programmatically created settings
var settings = new CacheHostConfigurationSettings { ... };
var cacheHost = new Dache.CacheHost.CacheHostEngine(settings);

Host Notes And Next Steps

To learn more about using Dache, check out the other pages of this wiki.