CacheLens.Core 0.1.1

dotnet add package CacheLens.Core --version 0.1.1
                    
NuGet\Install-Package CacheLens.Core -Version 0.1.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="CacheLens.Core" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CacheLens.Core" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="CacheLens.Core" />
                    
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 CacheLens.Core --version 0.1.1
                    
#r "nuget: CacheLens.Core, 0.1.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 CacheLens.Core@0.1.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=CacheLens.Core&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=CacheLens.Core&version=0.1.1
                    
Install as a Cake Tool

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, plus HybridCache L1. HybridCache stores its in-process tier in the registered IMemoryCache, so those entries are visible; its distributed tier is not. IDistributedCache is 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
0.1.1 118 8/23/2026
0.1.0 131 8/23/2026

Updates the package icon to the CacheLens monogram. No functional change from 0.1.0.