# bluele/gcache

An in-memory cache library for golang. It supports multiple eviction policies: LRU, LFU, ARC

Repository: https://github.com/bluele/gcache
Canonical: https://ross.abutalabs.com/products/gcache
Language: Go
License: MIT
License Family: permissive
Topics: go, golang, cache, in-memory, arc, lru, lfu
Last push: 2024-03-01T12:49:21+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4239, "days_push": 915, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2731, forks 280 (observed 2026-08-28T04:07:16.071316+00:00)

## What it is
GCache is an in-memory cache library for Go supporting multiple eviction policies (LRU, LFU, ARC) and expirable entries. It is goroutine-safe and offers optional event handlers and automatic value loading via loader functions.

## Use cases
- cache frequently accessed data in memory in a Go service
- evict least recently used entries when the cache is full
- cache entries with per-key expiration times
- automatically load and cache values on miss with a loader function
- track evictions and purges with event callbacks

## When to choose
- you need a lightweight, dependency-free in-memory cache in Go
- you want a choice of LRU, LFU, or ARC eviction policies
- you need TTL-based expiration and loader functions in a single cache

## When to avoid
- you need a distributed or shared cache across processes (use Redis or similar)
- you need persistence or a cache larger than available memory

## Facets
- artifact type: library
- maturity: stable
- function: caching
- domain: developer-tools, backend, performance
- platform: go
- tags: in-memory-cache, lru, lfu, arc, eviction-policies, goroutine-safe, ttl

## Member repositories
- bluele/gcache (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:16.071316+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:14:39.506909+00:00, confidence not recorded.
  - readme: https://github.com/bluele/gcache (fetched 2026-08-28T04:07:16.071316+00:00, sha c8308954bf75)
- Data as of 2026-08-30T08:39:29.467469+00:00.
