sanchescom/laravel-cache-memory
add() and Cache::lock() support let you ship single-flight work, job deduplication, per-host rate limiting, and read-modify-write protection without falling back to get() + put() races. For PMs, this turns a “performance cache” into a primitive you can use for correctness-sensitive workflows inside one machine/container.stats() and memory:stats expose segment key, usable capacity, bytes used/free, item and expired counts. PM can require dashboards, alerts on capacity headroom, and incident runbooks before rollout.flush() or memory overflow.add() and lock support, and the data is small, hot, and reconstructible.memory:stats) and can size the shared-memory segment deliberately.flush(), requestDeletion(), or overflow-driven eviction of held locks is unacceptable for your workflow. In this package locks share the cache key space and can be discarded with data.refresh(), persistence across restarts, or unbounded/ad-hoc cache growth. Capacity is fixed and overflow empties the store with a warning.For executives: This is a low-risk, non-breaking upgrade to a Laravel cache package that makes local shared-memory caching safe for concurrency and observable in production. It can reduce Redis load and latency for hot per-host data, and it adds atomic primitives for duplicate-work suppression and local locking. It is not a replacement for distributed locks; keep Redis for cross-host coordination. The business case is cost/latency reduction and fewer race-condition bugs, with contained blast radius because data is reconstructible and scoped to a host.
For engineering: 2.1.0 closes the main correctness gap: Cache::add() with TTL is atomic across processes, and MemoryStore now implements LockProvider with owner-checked release, plus stats() and memory:stats. The release is non-breaking. Use it for per-host single-flight, queue deduplication, and rate limiting. Do not use it for cross-node locks, durable locks, or locks that must survive flush()/overflow. Plan segment sizing, monitor the Artisan stats command, and treat overflow warnings as incidents. If a lock is correctness-critical across services, keep Redis/DB locks.
How can I help you explore Laravel packages today?