symfony/cache-contracts
Symfony Cache Contracts defines lightweight, PSR-friendly interfaces for cache and tag-aware caching, enabling consistent cache usage across Symfony components and third-party libraries. Use it to type-hint against stable APIs while swapping cache implementations.
symfony/cache). The contracts provide standardized interfaces (CacheItemPoolInterface, TagAwareCacheInterface, etc.) that Laravel’s core drivers (Redis, Memcached, APCu, etc.) already implement.symfony/cache (used by Laravel’s cache system).CacheItemPoolInterface or extend CacheItemPoolDecorator for advanced use cases.Cache::driver()) or integrating third-party libraries that adhere to the contracts.symfony/cache vs. doctrine/cache).Cache::tags())?config/cache.php) and facade (Cache::store()).CacheInterface), enabling flexibility for different use cases.CacheItemPoolInterface or extend CacheItemPoolDecorator.config/cache.php under stores.Cache facade (e.g., Cache::store('custom_driver')->get('key')).psr/cache and symfony/cache's SimpleCacheAdapter for PSR-16 compliance.config/cache.php).cache:clear, ArrayAdapter for testing).CachePoolDecorator to chain adapters (e.g., in-memory → persistent) for graceful degradation.CacheItem for cache entries).symfony/cache-contracts alone won’t cache anything—pair it with symfony/cache or a PSR-6-compatible adapter.symfony/cache v5+ uses cache-contracts v2+).FilesystemAdapter vs. ArrayAdapter) may affect data persistence.How can I help you explore Laravel packages today?