CacheLens.Core
0.1.1
dotnet add package CacheLens.Core --version 0.1.1
NuGet\Install-Package CacheLens.Core -Version 0.1.1
<PackageReference Include="CacheLens.Core" Version="0.1.1" />
<PackageVersion Include="CacheLens.Core" Version="0.1.1" />
<PackageReference Include="CacheLens.Core" />
paket add CacheLens.Core --version 0.1.1
#r "nuget: CacheLens.Core, 0.1.1"
#:package CacheLens.Core@0.1.1
#addin nuget:?package=CacheLens.Core&version=0.1.1
#tool nuget:?package=CacheLens.Core&version=0.1.1
CacheLens
Runtime visibility for ASP.NET Core IMemoryCache.
Browse cached keys, inspect values, and track expiration and hit counts — live, from inside VS Code, without changing a single line of your caching code.
This package is one half of CacheLens. It instruments your application; the CacheLens VS Code extension displays what it finds. You need both.
Install
dotnet add package CacheLens.AspNetCore
Then install the CacheLens extension in VS Code.
Use
Two lines in Program.cs:
using CacheLens.AspNetCore;
var builder = WebApplication.CreateBuilder(args);
if (builder.Environment.IsDevelopment())
{
builder.Services.AddCacheLens();
}
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.MapCacheLens();
}
app.Run();
Run your app. It appears in the CacheLens panel within a few seconds — there is no host, port, or token to configure anywhere.
Your existing Set / Get / GetOrCreate calls stay exactly as they are. CacheLens wraps
whatever IMemoryCache you already registered, from the outside.
Why the IsDevelopment() checks
CacheLens exposes the contents of your cache, which may include real customer data. Those checks keep it out of production. Please keep them.
The endpoint fails closed by default:
| Control | Behaviour |
|---|---|
| Loopback only | Requests from other hosts are rejected regardless of the bind address |
| Per-process token | A fresh bearer token each startup; the extension reads it automatically |
| Redaction | Keys containing password, token, secret and similar return metadata only |
| Payload ceiling | Values above 64 KB are reported by size rather than transmitted |
Configuration
builder.Services.AddCacheLens(options =>
{
options.RedactKeyPatterns = ["password", "secret", "token", "apikey"];
options.MaxValuePayloadBytes = 64 * 1024;
options.RoutePrefix = "/_cachelens";
options.EnableDiscovery = true;
});
Scope
Supports .NET 8 and .NET 9, ASP.NET Core applications.
Not yet supported, stated plainly:
IMemoryCache, plusHybridCacheL1. HybridCache stores its in-process tier in the registeredIMemoryCache, so those entries are visible; its distributed tier is not.IDistributedCacheis not tracked — the in-memory provider holds its own private cache.- ASP.NET Core only — console applications and worker services are not yet covered.
- Entries cached before CacheLens starts are not tracked.
Website · Documentation · Source · Issues
MIT licensed.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CacheLens.Core:
| Package | Downloads |
|---|---|
|
CacheLens.AspNetCore
Runtime visibility for ASP.NET Core IMemoryCache. Wraps your existing cache registration so the CacheLens VS Code extension can browse cached keys, inspect values, and track expiration and hit counts — without changing any of your caching code. Development-time only: loopback-bound, token-protected, and redacts secret-shaped keys by default. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Updates the package icon to the CacheLens monogram. No functional change from 0.1.0.