golang-samber-hot

Create customizable in-memory caches in Go with eviction policies and lifecycle management.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/matdev83/go-llm-interactive-proxy --skill golang-samber-hot-matdev83
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-samber-hot
Source: https://github.com/matdev83/go-llm-interactive-proxy/tree/main/.agents/skills/golang-samber-hot
Command: npx skills add https://github.com/matdev83/go-llm-interactive-proxy --skill golang-samber-hot-matdev83

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables developers to implement high-performance in-memory caching solutions tailored to complex workload patterns.

Core Features & Use Cases

  • Flexible Eviction Algorithms: Supports 9 algorithms like TinyLFU, ARC, and FIFO to optimize cache performance.
  • Advanced Cache Management: Offers TTL, loader chains, sharding, and metrics for production-grade caching.
  • Use Case: Improve API response times by caching user data efficiently while handling high concurrency and avoiding scan pollution.

Quick Start

Configure the hot cache with W-TinyLFU algorithm, set a TTL of 10 minutes, and enable Janitor for background cleanup.

Frequently Asked Questions about golang-samber-hot

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement an in-memory cache in Go with custom eviction policies?

To implement an in-memory cache in Go with custom eviction, use a framework supporting algorithms like TinyLFU, ARC, and FIFO. This allows you to tailor cache performance to specific workload patterns and optimize memory usage.

What is the best way to handle high concurrency in a Golang cache?

The best way to handle high concurrency in a Golang cache is by using sharding. Sharding divides the cache into independent segments, reducing lock contention and ensuring high throughput for concurrent read and write operations.

How does a loader chain work in a Go caching framework?

A loader chain in a Go caching framework sequentially attempts to fetch missing data from multiple sources. It populates the cache automatically during cache misses, preventing thundering herd problems and streamlining data retrieval.

Can I use TTL and background cleanup for a Go in-memory cache?

Yes, you can use TTL and background cleanup for a Go in-memory cache. Setting a TTL ensures data expires after a duration, while a Janitor process handles background eviction to maintain memory limits without manual intervention.

When do I need an advanced cache eviction algorithm like W-TinyLFU?

You need an advanced cache eviction algorithm like W-TinyLFU when dealing with scan pollution or skewed access patterns. It tracks frequency to retain hot items, improving cache hit rates significantly compared to basic LRU.

Does this Go caching framework support collecting performance metrics?

Yes, this Go caching framework supports collecting performance metrics. Built-in metrics monitoring tracks cache hits, misses, and evictions, enabling you to analyze production behavior and optimize throughput and latency.