home / skills / proxiblue / claude-skills / cache-diagnostic

cache-diagnostic skill

/cache-diagnostic

This skill analyzes Magento 2 cache configuration and performance across Redis, Varnish, and application caches, delivering actionable optimization

npx playbooks add skill proxiblue/claude-skills --skill cache-diagnostic

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.8 KB
---
name: cache-diagnostic
description: Specialized Magento 2 cache diagnostic skill for analyzing cache configuration, performance, hit rates, and optimization opportunities across all cache layers (Full Page Cache, Application Cache, Redis, Varnish).
---

This skill provides deep cache analysis and optimization recommendations for Magento 2.

## What This Skill Does

1. **Cache Configuration Analysis**
   - Cache type status for all 15+ Magento cache types
   - Backend configuration (File, Redis, Memcached)
   - Full Page Cache (FPC) backend (Varnish, Built-in, Redis)
   - Cache prefix and tag configuration
   - Cache lifetime settings

2. **Redis Analysis** (if applicable)
   - Redis connection and version
   - Memory usage and fragmentation
   - Keyspace analysis and database usage
   - Eviction policy and maxmemory settings
   - Hit rate statistics
   - Slow log analysis

3. **Varnish Analysis** (if applicable)
   - Varnish version and configuration
   - Hit rate and cache effectiveness
   - Backend health and response times
   - ESI hole configuration
   - Cache invalidation (PURGE) functionality
   - VCL configuration validation

4. **Cache Performance Metrics**
   - Cache hit/miss ratios per cache type
   - Cache size and growth trends
   - Cache warming status
   - Invalidation frequency and patterns
   - Cache-related errors and warnings

5. **Application Cache Analysis**
   - Config cache efficiency
   - Layout cache effectiveness
   - Block HTML cache usage
   - Collections cache status
   - EAV cache efficiency

## Diagnostic Commands

```bash
# Cache Status
bin/magento cache:status
bin/magento config:show --scope=default | grep cache

# Redis Analysis
redis-cli INFO
redis-cli INFO stats
redis-cli --latency
redis-cli SLOWLOG GET 10

# Varnish Analysis
varnishstat -1
varnishlog -q "RespStatus >= 400" -n 100
varnishadm vcl.list

Overview

This skill performs a focused Magento 2 cache diagnostic to identify configuration issues, measure performance, and surface optimization opportunities across all cache layers. It evaluates Full Page Cache, application caches, Redis, and Varnish to deliver actionable recommendations that reduce latency and improve hit rates. The output highlights misconfigurations, resource pressure, and quick wins for cache stability and speed.

How this skill works

The skill inspects Magento cache status, backend settings, and lifetime parameters, then collects live metrics from Redis and Varnish when present. It computes hit/miss ratios, analyzes Redis memory usage and slow logs, and validates VCL and backend health. Results combine configuration checks, performance metrics, and tailored optimization steps prioritized by impact.

When to use it

  • After a site migration or environment change that affects cache backends
  • When page load times or TTFB increase without clear cause
  • If Redis shows memory pressure, eviction, or unexplained latency
  • When Varnish cache hit rates are low or PURGE/invalidations misbehave
  • As part of routine performance audits before peak traffic events

Best practices

  • Ensure a single authoritative FPC backend is configured and avoid mixed backends across environments
  • Use Redis with appropriate maxmemory and eviction policy for session and cache segregation
  • Monitor Redis keyspace and fragmentation; tune persistence and eviction to avoid OOM events
  • Validate Varnish VCL for correct ESI and backend health checks; automate VCL deployment safely
  • Warm caches after deployment and reduce unnecessary invalidation by targeting tags and lifetimes

Example use cases

  • Detecting misconfigured cache backend after switching environments (file vs Redis)
  • Investigating low FPC hit rate and recommending VCL or cacheability adjustments
  • Identifying Redis memory fragmentation, recommending maxmemory and reindex strategies
  • Validating Varnish configuration and backend response behavior during traffic spikes
  • Prioritizing cache-related fixes before a planned marketing campaign to avoid cache stampedes

FAQ

Can this skill run diagnostics without direct server access?

It needs access to Magento CLI and, for Redis/Varnish checks, network or CLI access to those services. Limited diagnostics can run from Magento-only access but will be less comprehensive.

Will it change my cache configuration automatically?

No. The skill provides analysis and explicit recommendations. Implementing configuration changes should be done manually or with your deployment tooling after review.