laravel-performance-caching

Cache Laravel routes, configs, views, and queries with TTL-aware invalidation.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/mkopcic/md-solutions.hr-racuni-app --skill laravel-performance-caching-mkopcic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-performance-caching
Source: https://github.com/mkopcic/md-solutions.hr-racuni-app/tree/main/.github/skills/laravel-performance-caching
Command: npx skills add https://github.com/mkopcic/md-solutions.hr-racuni-app --skill laravel-performance-caching-mkopcic

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel apps often suffer from repeated database queries and expensive computations during requests and renders. This skill provides structured caching strategies to reduce redundant work while keeping data fresh.

Core Features & Use Cases

  • Framework caches: route:cache, config:cache, and view:cache to speed up bootstrapping and response times.
  • Value and query caching patterns: using Cache::remember with stable keys, optional tags, and locks to coordinate expensive work.
  • Real-world use case: cached dashboard metrics that refresh on a defined interval and are invalidated on writes to the underlying data.

Quick Start

Apply a caching strategy by converting frequent queries to Cache::remember calls with stable keys and explicit invalidation on writes.

Frequently Asked Questions about laravel-performance-caching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I cache database queries in Laravel to improve web application performance?

Cache frequent database queries in Laravel using Cache::remember with stable keys. This reduces repeated database work by storing results in memory, requiring explicit invalidation on subsequent writes to keep data fresh.

What's the best way to handle cache invalidation for Laravel dashboard metrics?

The best way to handle Laravel cache invalidation is combining TTL-aware expiration with explicit invalidation on writes. This ensures cached dashboard metrics refresh on a defined interval while remaining immediately accurate when underlying data changes.

How do cache tags and locks work for coordinating expensive Laravel queries?

Cache tags group related Laravel cache keys for simultaneous clearing, while locks prevent overlapping expensive computations during concurrent requests. These optional features coordinate updates and prevent redundant workload execution.

Does this caching strategy work with Laravel apps using Livewire and Flux UI?

Yes, this caching strategy applies to typical web applications built with Laravel, Livewire, and Flux UI. It optimizes response times by leveraging framework caches alongside value and query caches for frequently accessed data.

When do I need to use route, config, and view caching in Laravel?

Use route, config, and view caching in Laravel to speed up application bootstrapping and response times. These framework caches reduce redundant file loading and compilation overhead during every HTTP request.

Why does my cached Laravel data become stale after database writes?

Cached Laravel data becomes stale when invalidation is not explicitly triggered on writes. Applying TTL-aware invalidation alongside explicit cache clearing on data updates ensures stored values remain synchronized with the database.