.Net Core IDistributedCache implementation for Cassandra.
-
Create the table cassandra_cache in your Cassandra Keyspace. You can find the cql file inside the deploy folder.
-
Configure your application to make use of Cassandra.
-
Add the following code to
Startup.ConfigureServices
and perform the necessary changes:
services.AddDistributedCassandraCache(options =>
{
options.Session = <YourCassandraSession>;
options.Logger = <YourLogger>;
options.ReadConsistencyLevel = ConsistencyLevel.LocalQuorum;
options.WriteConsistencyLevel = ConsistencyLevel.LocalQuorum;
})
- To use the IDistributedCache interface, request an instance of IDistributedCache from any constructor in the app. The instance is provided by dependency injection (DI).
NuGet: https://www.nuget.org/packages/DistributedCache.Cassandra/