XiHan.Framework.Caching.InMemory 5.0.0-preview.1

Prefix Reserved
This is a prerelease version of XiHan.Framework.Caching.InMemory.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package XiHan.Framework.Caching.InMemory --version 5.0.0-preview.1
                    
NuGet\Install-Package XiHan.Framework.Caching.InMemory -Version 5.0.0-preview.1
                    
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="XiHan.Framework.Caching.InMemory" Version="5.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XiHan.Framework.Caching.InMemory" Version="5.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="XiHan.Framework.Caching.InMemory" />
                    
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 XiHan.Framework.Caching.InMemory --version 5.0.0-preview.1
                    
#r "nuget: XiHan.Framework.Caching.InMemory, 5.0.0-preview.1"
                    
#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 XiHan.Framework.Caching.InMemory@5.0.0-preview.1
                    
#: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=XiHan.Framework.Caching.InMemory&version=5.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=XiHan.Framework.Caching.InMemory&version=5.0.0-preview.1&prerelease
                    
Install as a Cake Tool

XiHan.Framework.Caching.InMemory

内存缓存。清单 role: default,提供 caching.local@1 与 caching.distributed@1:没有显式 Provider 时,进程内缓存与"共享"缓存都由它承担(只在单实例部署下正确)。

语义

  • 有界 LRU:XiHan:Caching:InMemory:MaxEntries(默认 10000),满时淘汰最久未访问的条目。

  • 过期:绝对存活或滑动过期;都不设时用 XiHan:Caching:InMemory:DefaultTimeToLiveSeconds(默认 300)。过期条目在访问时清理。

  • 对象缓存 InMemoryObjectCache 实现 ICacheInspector(ADR-0058):对象条目在它自己的表里、不在字节存储里,按同样的序数分页列出,查看给出对象的类型全名、剩余存活与滑动窗口(不读出值、不延长滑动过期),按前缀删除只删对象条目。

  • 字节存储实现 ICacheStoreInspector(ADR-0055):按键的序数顺序分页列出(续页标记是上一页最后一个键),读载荷字节数、剩余存活与滑动窗口(不更新访问顺序与滑动过期),按前缀删除返回其中仍存活的条数。

  • 字节存储写入复制字节,读取返回不可修改的视图;类型化缓存(ICache / ISharedCache)直接存对象引用、不序列化,调用方不得修改取回的对象。

  • 被选中提供 caching.distributed 时注册 ISharedCache、ICacheStore(字节级契约,指向同一个存储)、分布式锁与幂等中间件;当另一个显式 Provider(如 Caching.Redis)被选中提供 caching.distributed 时,本包只注册 ICache。

  • 健康项 caching.inmemory.capacity(InMemoryCacheHealthContributor,同步计算):两张表任一条目数达到 MaxEntries 即 Degraded(CACHING_UNAVAILABLE_002,缓存仍可用但每次写入都在淘汰),否则 Ready。

依赖方向

依赖 XiHan.Framework.Caching.Abstractions。

状态

P2:可用,通过 Caching.Conformance 套件。

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 (1)

Showing the top 1 NuGet packages that depend on XiHan.Framework.Caching.InMemory:

Package Downloads
XiHan.Framework.Profiles.Standard

曦寒框架 Standard 组合包

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.0-preview.2 48 11/6/2026
5.0.0-preview.1 44 11/4/2026