Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器clawhub未标认证来源可访问clear审计提醒

cache-strategy-advisor缓存策略顾问

Agent Skill

cache-strategy-advisor 用于处理浏览器自动化、网页检查和页面信息提取,适合在 OpenClaw 中需要让 Agent 打开页面、读取网页或验证前端流程时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,105

周安装

47

GitHub Stars

公开资料未说明

下载量

387
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cache-strategy-advisor(缓存策略顾问)
来源仓库:https://github.com/charlie-morrison/cache-strategy-advisor
安装命令:
openclaw skills install cache-strategy-advisor
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install cache-strategy-advisor

简介

cache-strategy-advisor 用于处理浏览器自动化、网页检查和页面信息提取,适合在 OpenClaw 中需要让 Agent 打开页面、读取网页或验证前端流程时使用。

  • 适用于分析缓存策略、推荐 CDN 或数据库层优化方案。
  • 可配置缓存层并模拟用户交互以测试前端行为。
  • 安装命令为 openclaw skills install cache-strategy-advisor,需确认网络访问权限。
  • 使用时需注意是否涉及真实用户数据或跨域请求等安全风险。

SKILL.md

name
cache-strategy-advisor
description
Design and optimize caching strategies for applications. Analyze data access patterns, recommend cache layers (browser, CDN, application, database), configure TTLs, invalidation policies, and measure cache hit rates.

Cache Strategy Advisor

Design caching strategies that actually improve performance without introducing stale data bugs. Analyze access patterns, recommend appropriate cache layers, configure TTLs and invalidation policies, measure hit rates, and identify cache-related issues.

Use when: "optimize caching", "cache strategy", "what should we cache", "cache hit rate is low", "stale data issues", "CDN caching", "Redis caching strategy", "cache invalidation", or when adding caching to an application.

Commands

1. analyze — Assess Current Caching

Step 1: Inventory Existing Cache Layers

# Check for Redis/Memcached
redis-cli ping 2>/dev/null && redis-cli info stats 2>/dev/null | grep -E "keyspace_hits|keyspace_misses|evicted_keys"
memcached-tool localhost:11211 stats 2>/dev/null | grep -E "get_hits|get_misses|evictions"

# Check for application-level caching
rg "cache\.|@cache|@Cacheable|lru_cache|memoize|NodeCache|redis\." \
  --type-not binary -g '!node_modules' -g '!vendor' 2>/dev/null | head -20

# Check CDN headers
curl -sI "https://$HOST" | grep -iE "cache-control|cdn-cache|x-cache|cf-cache|age:" 2>&1

# Check for HTTP caching headers
curl -sI "https://$HOST/api/products" | grep -iE "cache-control|etag|last-modified|vary:" 2>&1

Step 2: Measure Current Hit Rates

# Redis hit rate
redis-cli info stats 2>/dev/null | python3 -c "
import sys
stats = {}
for line in sys.stdin:
    if ':' in line:
        k, v = line.strip().split(':', 1)
        stats[k] = v
hits = int(stats.get('keyspace_hits', 0))
misses = int(stats.get('keyspace_misses', 0))
total = hits + misses
if total > 0:
    rate = hits / total * 100
    status = '🟢' if rate > 90 else '🟡' if rate > 70 else '🔴'
    print(f'{status} Cache hit rate: {rate:.1f}% ({hits:,} hits / {misses:,} misses)')
    print(f'Evictions: {stats.get(\"evicted_keys\", 0)}')
else:
    print('No cache activity')
"

# CDN hit rate (Cloudflare example)
# Check X-Cache or CF-Cache-Status headers across multiple requests
for i in $(seq 1 10); do
  curl -sI "https://$HOST/" | grep -i "cf-cache-status\|x-cache" 2>/dev/null
done | sort | uniq -c

Step 3: Identify Caching Opportunities

Analyze the application for:

High-value cache candidates:

  • Repeated database queries (same params, frequent calls)
  • Expensive computations (aggregations, reports, ML inference)
  • External API calls (rate-limited, slow, costly)
  • Static or rarely-changing data (config, feature flags, translations)
  • Session/auth data (user profiles, permissions)

Anti-patterns to flag:

  • Caching mutable data without invalidation
  • TTLs that don't match data change frequency
  • Cache-aside pattern without error handling (cache miss → DB → cache set)
  • Thundering herd on cache expiry (no jitter, no lock)
  • Over-caching (caching user-specific data in shared cache)
# Find repeated queries (Django example — enable logging)
# Look for similar queries in application code
rg "\.filter\(|\.get\(|SELECT.*FROM" --type py -g '!migrations' 2>/dev/null | \
  sed 's/[0-9]*//g' | sort | uniq -c | sort -rn | head -10

Step 4: Recommend Strategy

# Cache Strategy Report

## Current State
- Redis: ✅ Running, 85% hit rate, 2.3% eviction rate
- CDN: ⚠️ 45% hit rate (Cache-Control too short)
- Browser: ❌ No Cache-Control headers on static assets
- Application: ⚠️ Selective caching, 3 endpoints cached

## Recommendations

### Layer 1: Browser Cache
- Static assets (JS/CSS/images): `Cache-Control: public, max-age=31536000, immutable`
  Use content-hash filenames for cache busting
- HTML pages: `Cache-Control: no-cache` (revalidate every time)
- API responses: `Cache-Control: private, max-age=60` for user-specific data

### Layer 2: CDN Cache
- Product listings: 5 min TTL with stale-while-revalidate
- Images: 1 year TTL (content-addressed)
- API: bypass CDN for authenticated endpoints, cache public endpoints

### Layer 3: Application Cache (Redis)
| Data | TTL | Invalidation | Pattern |
|------|-----|-------------|---------|
| Product catalog | 5 min | On update + pub/sub | Read-through |
| User sessions | 30 min | On logout | Write-through |
| Search results | 2 min | TTL only | Cache-aside |
| Rate limit counters | 1 min | TTL only | Increment |
| Feature flags | 30 sec | On deploy | Read-through |

### Layer 4: Database Query Cache
- Enable PostgreSQL shared_buffers tuning
- Add materialized views for expensive aggregations
- Index covering queries for most frequent access patterns

## Invalidation Strategy
- Use pub/sub for real-time invalidation across instances
- Add jitter to TTLs: `TTL * (0.8 + random(0.4))` to prevent thundering herd
- Implement cache stampede protection (lock + stale-while-revalidate)

2. configure — Generate Cache Configuration

Output ready-to-use configuration for:

  • Nginx/Caddy proxy cache rules
  • Cloudflare/CloudFront cache policies
  • Redis cache-aside implementation with proper error handling
  • Application-level cache decorators

3. debug — Diagnose Cache Issues

For common cache problems:

  • Stale data: trace cache TTL vs data update frequency
  • Low hit rate: check key cardinality, TTL distribution, eviction policy
  • Memory pressure: analyze key size distribution, suggest eviction candidates
  • Thundering herd: detect mass expiry patterns, recommend jitter/locking

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

75.37%
按下载量换算292

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills