loom-caching
SolidCaching strategies for performance optimization — cache-aside, write-through, write-behind, TTL policies, eviction, and stampede prevention.
Code & Development 54 stars
3 forks Updated today MIT
Install
Quality Score: 87/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Caching
## Overview
Store expensive-to-compute or frequently-read data closer to the consumer. The easy part is the read path; the hard parts are **invalidation** (keeping it correct) and **stampede** (surviving a mass miss). This skill is organized around those failure modes, not around toy get/set wrappers.
## Strategy Selection
| Strategy | Read path | Write path | Consistency | Failure mode to watch |
| --- | --- | --- | --- | --- |
| **Cache-aside** (lazy) | App checks cache → loads on miss → populates | App writes DB, then **invalidates** (don't update) cache | Eventual; brief staleness window | Stampede on hot-key miss; race between load and invalidate |
| **Read-through** | Cache library loads on miss | (paired with write-through) | Eventual | Same as aside; hides loader in the cache layer |
| **Write-through** | Read from cache | Write DB **and** cache synchronously | Strong-ish; cache always fresh after write | Write latency = DB + cache; cache churn for rarely-read keys |
| **Write-behind** (write-back) | Read from cache | Write cache now, flush DB async in batches | Weak; **data loss if node dies before flush** | Lost writes on crash; ordering; DB divergence |
**Default to cache-aside.** It's simple, resilient (cache down ≠ writes fail), and puts invalidation in your control. Reach for write-through only when you can't tolerate a post-write stale read; write-behind only for write-heavy, loss-tolerant data (metrics, counters, activity feeds).
⚠ **On write, ...
Details
- Author
- cosmix
- Repository
- cosmix/loom
- Created
- 8 months ago
- Last Updated
- today
- Language
- Rust
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
Code & Development Listed
caching-strategies
Deep reference for caching — what to cache, cache-aside vs read/write-through/write-behind, TTLs with jitter, eviction (LRU/LFU/FIFO), invalidation, and surviving stampedes (thundering herd / dogpile). Worked examples and a runnable jitter check.
9 Updated 3 weeks ago
vanara-agents Code & Development Listed
cache
Cache. Redis, Memcached, Varnish, CDN, cache invalidation, TTL, write-through, cache stampede, thundering herd.
26 Updated 1 weeks ago
arbazkhan971 AI & Automation Listed
api-caching-strategies
Application-level caching strategies, HTTP caching, cache invalidation, and stampede prevention
24 Updated 3 days ago
agents-inc