CouchbaseDistributedCache Class

[namespace: Serenity.Caching, assembly: Serenity.Caching.Couchbase]

Couchbase is a distributed database that has Memcached like access interface.

You can get Serenity implementation for this server type in Serenity.Caching.Couchbase NuGet package.

Once you register it with the service locator:

  1. Dependency.Resolve<IDependencyRegistrar>()
  2. .RegisterInstance<IDistributedCache>(new CouchbaseDistributedCache())

You can configure CouchbaseDistributedCache in application configuration file (with JSON format):

  1. <appSettings>
  2. <add key="DistributedCache" value='{
  3. ServerAddress: "http://111.22.111.97:8091/pools",
  4. BucketName: "primary-bucket",
  5. KeyPrefix: ""
  6. }' />

Here ServerAddress is Couchbase server address and BucketName is the bucket name.

If you wanted to use same server / bucket for more than one application you can put something like DEV:, TEST: into KeyPrefix setting.