drapor/cache-repository
drapor/cache-repository provides a clean repository-style layer over Laravel caching, letting you store, retrieve, and invalidate cached data through a simple, consistent interface. A lightweight package for keeping cache logic organized and easy to swap or extend.
Cache::remember calls with inconsistent TTLs.Consider it when:
Look elsewhere when:
upsert, raw queries, relation cascades). Mature alternatives and first-party Cache::remember with explicit keys are lower-risk.To executives: This is a small, narrowly scoped library that caches database query results for our Laravel read paths. It is cheap to trial and could reduce database load and page latency without new infrastructure. It is also immature — 12 stars and no downstream dependents — so the recommendation is a time-boxed pilot behind our own interface, not an adoption. If the pilot succeeds, we keep the abstraction and swap the implementation; if it fails, we've spent two weeks and learned what our invalidation requirements actually are. The downside is bounded; the upside is a reusable pattern for read-path performance.
To engineering: Treat it as a reference implementation and a possible short-term accelerator, not a dependency of record. Wrap it behind an internal repository contract, assume we may fork it, and require a kill switch plus hit-rate and staleness metrics before it touches a production read path. Budget explicit design time for invalidation — that's where the real risk lives, not in the caching itself.
How can I help you explore Laravel packages today?