zendframework/zend-cache
zendframework/zend-cache provides flexible caching for PHP apps with multiple storage backends (filesystem, memory, APCu, Redis, and more). Supports cache patterns, plugins, serialization, and configurable adapters to improve performance and reduce repeated work.
zend-cache is a mature but archived caching library from the Zend Framework ecosystem, now maintained under Laminas. To begin:
composer require laminas/laminas-cache (the package was migrated to laminas/laminas-cache after Zend Framework end-of-life)Laminas\Cache\Storage\StorageInterface and the built-in adapters (Filesystem, Memory, Apcu, Redis, Memcached)StorageFactory::factory(['adapter' => 'filesystem', 'options' => ['directory' => '/tmp/cache']])Laminas\Cache\Service\StorageAdapterAbstractServiceFactory for integration with Laravel’s service containerTaggableStorageInterface (e.g., with Filesystem adapter) to invalidate groups of cache items by tags ($storage->invalidateTags(['user_data']))config/cache.php, mapping Laravel’s cache.stores to Laminas adapters where possible (e.g., use redis store → redis adapter with Laravel’s redis client)Laminas\Cache\Storage\Adapter\StreamWrapper or custom wrapper to make Laminas adapters work with Laravel’s Cache::driver() if neededlaminas/laminas-cache 2.12+phpserialize) doesn’t work well with Laravel’s serialized models; use igbinary or json via adapter options (['serializer' => 'json'])getMetadata($key) to inspect TTL, mtime, and tags—useful for debugging stale or expired entriesCache::remember() unless you manually bridge adapters—prefer one system for consistencyLaminas\Cache\Storage\Adapter\AbstractAdapter for custom storage backends (e.g., custom Laravel DB store), implementing setOptions() and _processOptions() carefullyHow can I help you explore Laravel packages today?