alastairtree/LazyCache
An easy to use thread safe in-memory caching service with a simple developer friendly API for c# observed · 2026-08-28
Health v2 · maintenance only
44/100
- Activity 46
- Release rhythm 8
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 4571
- days_rel: n/a
- days_push: 328
- n_releases_24m: 0
Adoption not part of the score
1757 stars · 163 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
LazyCache is a thread-safe in-memory caching library for .NET with a simple generics-based GetOrAdd API built on Microsoft.Extensions.Caching and Lazy<T>. It guarantees cachable delegates execute only once, even under heavy load.
Use cases
- cache expensive database query results in memory
- avoid duplicate concurrent cache misses for the same key
- cache web service or API call responses in a dotnet app
- add caching to .NET code without writing double-checked locking
- cache complex object graph building routines
- share a single in-memory cache across an application via dependency injection
When to choose
- you want a simple, developer-friendly in-memory cache for .NET with atomic GetOrAdd semantics
- you need thread-safe caching that executes factory delegates exactly once under load
- you want a lightweight alternative to managing MemoryCache locking patterns yourself
When to avoid
- you are starting a new ASP.NET Core project - Microsoft's built-in HybridCache now solves most of the same problems with better long-term support
- you need distributed caching across multiple servers
- you need cache eviction policies beyond what MemoryCache provides
Facets
library · maturity maintenance
caching developer-tools performance backend dotnet cross-platform in-memory-cache thread-safe getoradd lazy-evaluation dotnet
3 sources
- readme: https://github.com/alastairtree/LazyCache · fetched 2026-08-28 · 35d29131f4d2
- homepage: https://nuget.org/packages/LazyCache · fetched 2026-08-29 · 878bcc4579a5
- site_page: https://www.nuget.org/policies/About · fetched 2026-08-29 · a113b8a074c9
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| alastairtree/LazyCache | main | 44 |
For agents
markdown · JSON · MCP: product_card(name="alastairtree/LazyCache")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem