Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Cache Memory Laravel Package

sanchescom/laravel-cache-memory

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature bets that need safe concurrency on a single host. The new atomic 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.
  • Cost/latency roadmap. If Redis is a hotspot or cost line for hot, small, read-heavy data (feature flags, permissions, config, tenant metadata), this package offers a local shared-memory tier. PM can frame it as reducing network hops and Redis QPS, with a fallback to Redis for cross-host coordination.
  • Operational readiness and capacity planning. 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.
  • Build vs. buy. Do not build a shared-memory cache store and locking layer in-house; adopt the package for the Laravel integration. The 2.1.0 release adds proven atomic semantics and observability, lowering the “build” argument.
  • Use cases to prioritize: per-host cache for hot reference data; duplicate-job suppression in queue workers on the same host; short-lived locks around local resource access; cache-stampede protection. Use cases to avoid: cross-service or multi-node mutual exclusion, durable locks, and locks that must survive flush() or memory overflow.

When to Consider This Package

  • Consider it when your Laravel app runs multiple PHP-FPM/queue/CLI processes on the same host or container and needs a fast, shared cache with atomic add() and lock support, and the data is small, hot, and reconstructible.
  • Consider it when Redis is a latency or cost bottleneck for local reads, or when you want to reduce Redis QPS for per-host coordination.
  • Consider it when you need observable cache capacity (memory:stats) and can size the shared-memory segment deliberately.
  • Look elsewhere when you need distributed locks across hosts, lock durability, or strict mutual exclusion across services—use Redis, database, or a dedicated coordination service.
  • Look elsewhere if 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.
  • Look elsewhere if you need lock refresh(), persistence across restarts, or unbounded/ad-hoc cache growth. Capacity is fixed and overflow empties the store with a warning.
  • Adopt with caution if your team lacks operational ownership for shared-memory sizing and warning monitoring; a masked overflow warning could otherwise hide lost writes.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator