symfony/cache-contracts
A set of cache abstractions extracted from Symfony components. It defines interfaces such as CacheInterface, CacheItemInterface, and TagAwareCacheInterface, letting libraries depend on proven cache semantics without binding to a concrete implementation.
TagAwareCacheInterface), deferred/batched commits, multi-tier fallback chains — without committing engineering to a specific provider.Adopt when:
CacheItemPoolInterface lets you swap in an array adapter for unit tests.Look elsewhere when:
symfony/cache (or another PSR-6 implementation) or the decision is incomplete.Cache facade for straightforward remember/put/get work — use the framework as-is; no additional decision is required.psr/simple-cache and the appropriate adapter rather than conflating the two.For executives (one paragraph): We are standardizing our caching layer on a free, MIT-licensed, industry-maintained set of interfaces that is already part of our Laravel stack. It costs us essentially nothing to adopt and lets us change or add cache providers — Redis, Memcached, cloud caches — without rewriting application code. That means lower switching costs, less vendor lock-in, faster delivery on cache-dependent features, and reduced long-term maintenance risk, governed by the same open-source project that maintains the framework components we already depend on.
For engineering leads: This is already a transitive dependency of Laravel (via symfony/cache) — no new install, no migration for existing projects. The value is architectural discipline: code against CacheItemPoolInterface / CacheInterface / TagAwareCacheInterface, not concrete adapters. You get testability (swap in an array adapter), tag-based invalidation, deferred commits, and fallback chains, with the contracts maintained upstream at low risk. Key caveats to internalize: the package provides interfaces only — pair it with symfony/cache or another PSR-6 implementation; keep contract versions aligned with the adapter and Laravel's constraints; don't confuse PSR-6 here with PSR-16. Custom drivers should be unit-tested against Laravel's cache test suite and rolled out incrementally to non-critical data first. The technical risk is low and the ramp-up is minimal for anyone familiar with Laravel's cache facade.
How can I help you explore Laravel packages today?