iazaran/smart-cache
Drop-in replacement for Laravel’s Cache facade that automatically compresses and chunks large values, deduplicates unchanged writes, self-heals corrupted entries, and performs cost-aware eviction. Works with existing code (PHP 8.1+, Laravel 8–13).
file_get_contents + manual serialization) to use Laravel’s standardized cache facade.Log::debug("Cache hit: {$key}")) with built-in metrics and dashboards.Adopt if:
Cache::remember wrappers, chunking logic).Look elsewhere if:
Illuminate\Contracts\Cache\Repository support.ext-zlib/ext-json benefits).For Executives: "SmartCache is a drop-in upgrade to Laravel’s built-in caching that automatically optimizes large payloads, reducing infrastructure costs and improving response times for data-heavy features. For example, it compressed a 323KB API response to 7.8KB (97% smaller) in our benchmarks—cutting Redis memory usage and read latency without code changes. It also handles edge cases like corrupted cache entries or cache stampedes automatically, reducing toil for our ops team. The built-in dashboard and audit tools give us visibility into cache performance, helping us prioritize optimizations where they matter most. With zero configuration for 80% of use cases, this is a low-risk, high-reward upgrade to our caching layer."
For Engineering:
*"This replaces ad-hoc caching hacks (e.g., manual gzip + serialize) with a Laravel-native facade that:
put() calls for unchanged data).Migration effort: 5 minutes to swap Cache:: for SmartCache:: in your codebase. No breaking changes—it implements Illuminate\Contracts\Cache\Repository and PSR-16. Opt-in features (e.g., encryption, lazy loading) are configurable via config/smart-cache.php.
Key tradeoffs:
How can I help you explore Laravel packages today?