byjg/cache-engine
byjg/cache-engine is a flexible PHP caching library with a consistent API and pluggable backends like Redis, Memcached, APCu, files, and databases. It makes adding portable, fast caching to PHP and Laravel applications straightforward.
byjg/cache-engine implements both PSR-6 (CacheItemPoolInterface) and PSR-16 (SimpleCacheInterface) over a driver abstraction (Redis, Memcached, file system, APCu, PDO/database, array, null). Architecturally this mirrors Laravel's own CacheManager + driver pattern, which is a double-edged sword: the design is idiomatic, but the overlap with Illuminate\Cache means adopting it introduces a second caching abstraction alongside the one the framework already ships. The strongest strategic case is narrow — PSR-6 consumption (Laravel only adapts to PSR-16 via Psr16Cache, not PSR-6) or a specific driver Laravel does not natively support.config/cache.php + config/database.php connection definitions onto the package's own driver configuration, and reconciling serialization/TTL semantics with Illuminate\Cache so behavior is predictable across both layers. Estimate 1–2 sprints including tests; not a drop-in.Illuminate\Cache? If none, the value is marginal.Psr\SimpleCache\CacheInterface and/or Psr\Cache\CacheItemPoolInterface to a configured driver instance. If the goal is to slot it under Laravel, use Cache::extend() to register a custom Illuminate\Contracts\Cache\Store driver instead, keeping the framework facade intact. If the goal is to satisfy a library's PSR-6 dependency, bind the interface scoped to that library only.Illuminate\Cache globally. Introduce the package for a single, non-critical consumer first (typically a third-party package requiring PSR-6/PSR-16), feature-flag it, and shadow-compare reads/writes against the current cache to validate key/TTL/serialization parity before broadening usage. Retain Laravel's cache as the default for application-level concerns (sessions, queues, rate limiting).ext-redis, ext-memcached, ext-apcu, PDO). Pin an exact version and record the commit SHA; add composer audit and a periodic upstream check to the dependency-review routine. Confirm the package does not pull conflicting PSR interface versions.Illuminate\Cache, inconsistent TTL (notably 0, negative, and DateTimeInterface handling), missing stampede/locking semantics, key collisions across two cache layers, and silent no-op degradation in the Null/Array drivers. Any dual-cache architecture must define a single source of truth per key namespace to avoid stale-read divergence.How can I help you explore Laravel packages today?