Using MemCachier
MemCachier is fully managed Memcached-service.
When you add MemCachier to your app, the following configuration
variables will be injected: MEMCACHIER_SERVERS
,
MEMCACHIER_USERNAME
and
MEMCACHIER_PASSWORD
.
To use MemCachier from your app, we recommend EnyimMemcached. The
easiest way to install the client is using NuGet:
Install-Package EnyimMemcached
.
With that in place, you can instantiate a client like this:
public static MemcachedClient GetClient()
{
var configuration = new MemcachedClientConfiguration();
configuration.AddServer(ConfigurationManager.AppSettings["MEMCACHIER_SERVERS"]);
configuration.Protocol = MemcachedProtocol.Binary;
configuration.Authentication.Type = typeof(PlainTextAuthenticator);
configuration.Authentication.Parameters["userName"] =
ConfigurationManager.AppSettings["MEMCACHIER_USERNAME"];
configuration.Authentication.Parameters["password"] =
ConfigurationManager.AppSettings["MEMCACHIER_PASSWORD"];
configuration.Authentication.Parameters["zone"] = "AUTHZ";
return new MemcachedClient(configuration);
}