Naravel.Cache.Memcached 0.2.0

dotnet add package Naravel.Cache.Memcached --version 0.2.0
                    
NuGet\Install-Package Naravel.Cache.Memcached -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Naravel.Cache.Memcached" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Naravel.Cache.Memcached" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Naravel.Cache.Memcached" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Naravel.Cache.Memcached --version 0.2.0
                    
#r "nuget: Naravel.Cache.Memcached, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Naravel.Cache.Memcached@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Naravel.Cache.Memcached&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Naravel.Cache.Memcached&version=0.2.0
                    
Install as a Cake Tool

Naravel.Cache.Memcached

NuGet Downloads .NET 10 License: MIT

Memcached cache and lock providers for Naravel.Cache.

Fact Detail
Install dotnet add package Naravel.Cache.Memcached
Targets .NET 10
Needs Naravel.Cache, which NuGet installs with it
Client EnyimMemcachedCore, one shared client for every Memcached store

What you get

  • Memcached behind the same cache. Name "Driver": "memcached" in a store, and the cache calls you already use read and write Memcached.
  • Locks across instances. MemcachedLock acquires a lock atomically and releases it with the token it handed out.
  • Counters with a TTL. IncrementAsync and DecrementAsync, plus an overload that sets the expiry when it creates the counter.
  • One client for every store. All Memcached stores share one server pool, so they must list the same servers; registration throws otherwise, and changing the list needs a restart.

Quick start

builder.Services.AddNaravelCache(builder.Configuration).AddNaravelMemcachedCache(builder.Configuration);
{ "Cache": { "Default": "memcached", "Stores": { "memcached": { "Driver": "memcached", "Servers": { "primary": { "Address": "localhost", "Port": "11211" } } } } } }

Inject ICacheStore as usual; it now reads and writes Memcached. FlushAsync clears the whole Memcached cluster, not only this store's keys, so invalidate a subset with tags. Lock release has a small read/delete race: use Redis for critical sections.

Package Adds
Naravel.Cache Named stores, tags, scopes and locks that this provider backs
Naravel.Cache.Redis The Redis provider: atomic lock release, and a flush that stays inside the store's prefix

Learn more

Part of Naravel: Laravel's names, .NET's type system. All Naravel packages share one version.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 97 11/13/2026
0.1.1 99 11/2/2026
0.1.0 112 11/1/2026