Make use of caching without any hassle.
Nebula.Caching is an Open-Source caching library that allows you to use caching in your projects with minimal configuration.
As of today, we support caching using Redis, InMemory and Memcached, but in the future we hope to support your favourite caching provider!
Name | Released Package |
---|---|
NebulaCaching.Redis | |
NebulaCaching.InMemory | |
NebulaCaching.Memcached |
Install the package via Package Manager:
Install-Package NebulaCaching.Redis
Install-Package NebulaCaching.InMemory
Install-Package NebulaCaching.Memcached
or
Via .NET CLI:
dotnet add package NebulaCaching.Redis
dotnet add package NebulaCaching.InMemory
dotnet add package NebulaCaching.Memcached
Step 2 : Register cache usage in the Program class (will change depending on which caching provider you are using, please refer to the package documentation)
public class Program
{
public static void Main(string[] args)
{
// ...
builder.Host.UseNebulaCaching();
builder.Services.AddRedisChache(new RedisConfigurations
{
//some amazing configuration options which can be see in the samples or documentation section
});
}
}
Step 3 : Use the caching attribute in your interface definitions (will change depending on which caching provider you are using, please refer to the package documentation)
public interface IRedisStuff
{
[RedisCache(CacheDurationInSeconds = 120)]
List<SomeObject> SomeMethod(int param1, int param2);
}
Our documentation can be found here.
Some useful code snippets can be found here.
To check what we want to achieve in the future, please refer to our ROADMAP.
This project welcomes and appreciates any contributions made.
There are several ways you can contribute, namely:
- Report any bug found.
- Suggest some features or improvements.
- Creating pull requests.
Nebula.Caching is a free and open-source software licensed under the MIT License.
See LICENSE for more details.