From superpowers-laravel
Implements Laravel caching: framework caches via artisan, value/query caching with remember(), tags for grouped invalidation, locks against thundering herds, and explicit strategies for performance and correctness.
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers-laravel:performance-cachingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```
php artisan route:cache
php artisan config:cache
php artisan view:cache
Clear with the corresponding clear commands when needed in deployments.
Cache::remember("post:{$id}", 600, fn () => Post::findOrFail($id));
// Stable keys and scopes (e.g., tenant, locale)
Cache::remember("tenant:{$tenantId}:users:index:page:1", now()->addMinutes(5), function () {
return User::with('team')->paginate(50);
});
// Tags (supported drivers) for grouped invalidation
Cache::tags(['users'])->remember('users.index.page.1', now()->addMinutes(5), fn () => ...);
Cache::tags(['users'])->flush();
// Locks to ensure exclusive expensive work
Cache::lock('reports:daily', 30)->block(5, function () {
generateReports();
});
remember() to prevent thundering herdsnpx claudepluginhub jpcaparas/superpowers-laravel --plugin superpowers-laravelProvides Laravel caching best practices: remember/forever/flexible patterns, tags for invalidation, atomic locks. Optimizes performance in data-heavy apps.
Provides expert Laravel patterns for PHP 8.2+ including Eloquent ORM best practices, N+1 prevention, efficient queries, atomic operations, query optimization, and RESTful API controllers.
Analyzes cache strategies, invalidates patterns, and detects issues in Redis, Memcached, or in-memory caches. Guides TTL assessment, access pattern analysis, and anti-pattern detection.