Skip to content

A distributed cache implementation based on MongoDb

License

Notifications You must be signed in to change notification settings

ruzanowski/MongoDbCache

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MongoDbCache

A distributed cache implementation based on MongoDb, inspired by RedisCache and SqlServerCache (see https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed).

How do I get started?

Install the nuget package

PM> Install-Package MongoDbCache

You can either choose to use the provided extension method or register the implementation in the ConfigureServices method:

public void ConfigureServices(IServiceCollection services)
{  
	services.AddMongoDbCache(options => {
		options.ConnectionString = "mongodb://localhost:27017",
		options.DatabaseName = "MongoCache",
		options.CollectionName = "appcache",
		options.ExpiredScanInterval = TimeSpan.FromMinutes(10)
	});
}

MongoDbCache implements IDistributedCache, therefore you can use all the sync and async methods provided by the interface, please see https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed.

About

A distributed cache implementation based on MongoDb

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%