rennokki/laravel-eloquent-query-cache
remember(), rememberForever(), or rememberFor() methods.cache()->forget()) or automatic invalidation via model events (saved, deleted, etc.).Model::all()) may bloat cache storage. Mitigate by using rememberFor() with short TTLs or pagination.ModelObserver) or manual tags?Cache::remember).Product::where('category', $id)->get()).rememberFor(seconds) to test TTLs before committing to rememberForever.php artisan vendor:publish --provider="RenokiCo\QueryCache\QueryCacheServiceProvider").Model::create() → Model::fresh()).Model::withScopes(...)->remember(...)).DB::select() with manual caching).spatie/laravel-query-builder). Test thoroughly.cache()->tags() for manual invalidation).Model@query:hash).CACHE_POLICIES.md.QueryCache::clear() or cache()->flush() for troubleshooting.Log::debug('Cache miss:', ['query' => $query])).rememberFor() or pagination.cache()->tags() for distributed invalidation across pods.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Cache driver down | Degraded performance (fallback to DB) | Configure cache()->driver('file') as backup. |
| Stale cache served | Inconsistent data | Implement strict invalidation + health checks. |
| Cache bloat (OOM) | High memory usage | Set max cache size (Redis maxmemory-policy). |
| Race condition in invalidation | Partial data updates | Use atomic operations (e.g., Redis transactions). |
| Query cache key collisions | Overwritten data | Use unique prefixes (e.g., app@model:query). |
remember() vs. manual caching.How can I help you explore Laravel packages today?