All Projects → neosmart → AspSqliteCache

neosmart / AspSqliteCache

Licence: other
An ASP.NET Core IDistributedCache provider backed by SQLite

Programming Languages

C#
18002 projects
shell
77523 projects

Projects that are alternatives of or similar to AspSqliteCache

Easycaching
💥 EasyCaching is an open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!
Stars: ✭ 1,047 (+2584.62%)
Mutual labels:  aspnetcore, sqlite, cache
PersianDataAnnotations
PersianDataAnnotations is ASP.NET Core MVC & ASP.NET MVC Custom Localization DataAnnotations (Localized MVC Errors) for Persian(Farsi) language - فارسی سازی خطاهای اعتبارسنجی توکار ام.وی.سی. و کور.ام.وی.سی. برای نمایش اعتبار سنجی سمت کلاینت
Stars: ✭ 38 (-2.56%)
Mutual labels:  aspnetcore, nuget
MQTTnet
MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
Stars: ✭ 3,309 (+8384.62%)
Mutual labels:  nuget, netcore
IGeekFan.AspNetCore.Knife4jUI
support .NET Core3.0+,.NET Standard2.0 Swagger UI knife4j ui,you can use NSwagger or Swashbuckle.AspNetCore in packages
Stars: ✭ 178 (+356.41%)
Mutual labels:  aspnetcore, nuget
SharpPlugs
.Net Core 鋒利扩展
Stars: ✭ 26 (-33.33%)
Mutual labels:  aspnetcore, netcore
XAF Security E4908
This repository contains examples for Role-based Access Control, Permission Management, and OData / Web / REST API Services for Entity Framework and XPO ORM
Stars: ✭ 47 (+20.51%)
Mutual labels:  aspnetcore, netcore
grandnode2
Free, Open source, Fast, Headless, Multi-tenant eCommerce platform built with .NET Core, MongoDB, AWS DocumentDB, Azure CosmosDB, LiteDB, Vue.js.
Stars: ✭ 626 (+1505.13%)
Mutual labels:  aspnetcore, netcore
Revo
Event Sourcing, CQRS and DDD framework for C#/.NET Core.
Stars: ✭ 162 (+315.38%)
Mutual labels:  aspnetcore, netcore
Awesome-Nuget-Packages
📦 A collection of awesome and top .NET packages sorted by most popular needs.
Stars: ✭ 87 (+123.08%)
Mutual labels:  aspnetcore, netcore
SQLiteEncryptionUsingEFCore
SQLite Encryption using Entity Framework Core (EFCore)
Stars: ✭ 42 (+7.69%)
Mutual labels:  sqlite, netcore
Extended-Toolkit
A companion toolkit for the standard toolkit.
Stars: ✭ 83 (+112.82%)
Mutual labels:  nuget, netcore
Blazortable
Blazor Table Component with Sorting, Paging and Filtering
Stars: ✭ 249 (+538.46%)
Mutual labels:  aspnetcore, nuget
Aspnetcoremultipleproject
ASP.NET Core API EF Core and Swagger
Stars: ✭ 189 (+384.62%)
Mutual labels:  aspnetcore, sqlite
dark-sky-core
A .NET Standard Library for using the Dark Sky API.
Stars: ✭ 55 (+41.03%)
Mutual labels:  nuget, netcore
Netcorecms
NetCoreCMS is a modular theme supported Content Management System developed using ASP.Net Core 2.0 MVC. Which is also usable as web application framework. This project is still under development. Please do not use before it's first release.
Stars: ✭ 165 (+323.08%)
Mutual labels:  aspnetcore, netcore
X.Extensions.Logging.Telegram
Telegram logging provider
Stars: ✭ 32 (-17.95%)
Mutual labels:  aspnetcore, netcore
DevOpsExamples
A repo to show you how to use a private NuGet feed, such as Telerik, to restore packages in Azure DevOps, GitHub Actions, GitLab CI and AppCenter.
Stars: ✭ 16 (-58.97%)
Mutual labels:  aspnetcore, nuget
Formhelper
ASP.NET Core - Transform server-side validations to client-side without writing any javascript code. (Compatible with Fluent Validation)
Stars: ✭ 155 (+297.44%)
Mutual labels:  aspnetcore, netcore
Aspnetcoreangularsignalr
SignalR ASP.NET Core Angular
Stars: ✭ 163 (+317.95%)
Mutual labels:  aspnetcore, sqlite
comcms
COMCMS_Core 版本
Stars: ✭ 32 (-17.95%)
Mutual labels:  aspnetcore, netcore

SqliteCache for ASP.NET Core

SqliteCache is a persistent cache implementing IDistributedCache for ASP.NET Core projects.

SqliteCache uses a locally stored SQLite database file (taking advantage of SQLite's battle-tested safe multi-threaded access features) to replicate persistent caching, allowing developers to mimic the behavior of staging or production targets without all the overhead or hassle of a traditional IDistributedCache implementation. You can read more about its design and inspiration in the official release post on the NeoSmart blog.

Why NeoSmart.Caching.Sqlite?

The currently available options for caching in ASP.NET Core projects are either all ephemeral in-memory cache offerings (IMemoryCache and co.) -- aka non-persistent -- or else have a whole slew of dependencies and requirements that require at the very least administrator privileges and background services hogging up system resources and needing updates and maintenance to requiring multiple machines and a persistent network configuration.

  • NeoSmart.Caching.Sqlite has no dependencies on background services that hog system resources and need to be updated or maintained (cough cough NCache cough cough)
  • NeoSmart.Caching.Sqlite is fully cross-platform and runs the same on your Windows PC or your colleagues' Linux, FreeBSD, and macOS workstations (unlike, say, Redis)
  • NeoSmart.Caching.Sqlite doesn't need administrator privileges to install - or even any installation for that matter (SQL Express LocalDB, this one is aimed at you)
  • NeoSmart.Caching.Sqlite is a fully contained IDistributedCache offering that is installed and updated alongside the rest of your packages via NuGet, Paket, or whatever other option you're already using to manage your dependencies.

Installation

SqliteCache is available via the NuGet, and can be installed in the Package Manager Console as follows:

Install-Package NeoSmart.Caching.Sqlite

Usage

Using SqliteCache is straight-forward, and should be extremely familiar for anyone that's configured an ASP.NET Core application before. Starting by adding a namespace import using NeoSmart.Caching.Sqlite makes things easier as the editor will pull in the correct extension methods.

If using SqliteCache in an ASP.NET Core project, the SQLite-backed cache should be added as an IDistributedCache type by adding the following to your ConfigureServices method, by default located in Startup.cs:

// using NeoSmart.Caching.Sqlite;

public void ConfigureServices(IServiceCollection services)
{
    ...

    // Note: this *must* come before services.AddMvc()!
    services.AddSqliteCache(options => {
        options.CachePath = @"C:\data\bazaar\cache.db";
    });

    services.AddMvc();

    ...
}

Afterwards, the SqliteCache instance will be made available to both the framework and the application via dependency injection, and can be imported and used via either the IDistributedCache abstract type or the concrete SqliteCache type:

// using Microsoft.Extensions.Caching.Distributed;
public class FooModel(DbContext db, IDistributedCache cache)
{
    _db = db;
    _cache = cache;

    cache.SetString("foo", "bar");
    Assert.AreEqual(cache.GetString("foo"), "bar");

    Assert.AreEqual(typeof(NeoSmart.Caching.Sqlite.SqliteCache),
                    cache.GetType());
}

License

SqliteCache is developed and maintained by Mahmoud Al-Qudsi of NeoSmart Technologies. The project is provided free to the community under the terms of the MIT open source license.

Contributing

We are open to pull requests and contributions aimed at the code, documentation, unit tests, or anything else. If you're mulling an extensive contribution, file an issue first to make sure we're all on the same page, otherwise, PR away!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].