Overview

Data Types

Cache Invalidation

  1. An application can remove the data in the cache.
  2. Configure the invalidation rule while setting up the cache.

.NET Client

private static Lazy<ConnectionMultiplexer> _LazyConnection = new Lazy<ConnectionMultiplexer>(() =>
{
    return ConnectionMultiplexer.Connect(ConfigurationManager.AppSettings["CacheConnection"]);
});

public static ConnectionMultiplexer Connection => _LazyConnection.Value;

static void Main(string[] args)
{
    IDatabase cache = Connection.GetDatabase();
    cache.Ping(); // PING command.

    // Simple get and put of integral data types into the cache.
		var cacheValue = cache.StringGet("Message");
		cacheValue = cache.StringSet("Message", "Hello! The cache is working!");

    // Get the client list, useful to see if connection list is growing...
    var clientList = cache.Execute("CLIENT", "LIST").ToString();

    _LazyConnection.Value.Dispose();
}

Caching guidance

qishibo/AnotherRedisDesktopManager

Untitled