Token导航 LogoToken导航TokenDH.com
运维操作浏览器clawhub未标认证来源可访问clear审计通过

cachingcaching 开发

Agent Skill

caching 用于补充运维相关能力,适合在 OpenClaw 中需要让 Agent 承接运维相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

33,244

周安装

1,358

GitHub Stars

公开资料未说明

下载量

10,647
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install caching

简介

缓存策略、失效、逐出策略、HTTP 缓存、分布式缓存和反模式。在设计缓存层、选择逐出策略、调试陈旧数据或优化读取密集型工作负载时使用。

SKILL.md

name
caching
model
standard
description
Caching strategies, invalidation, eviction policies, HTTP caching, distributed caching, and anti-patterns. Use when designing cache layers, choosing eviction policies, debugging stale data, or optimizing read-heavy workloads.

Caching Patterns

A well-placed cache is the cheapest way to buy speed. A misplaced cache is the most expensive way to buy bugs.

Cache Strategies

StrategyHow It WorksWhen to Use
Cache-Aside (Lazy)App checks cache → miss → reads DB → writes to cacheDefault choice — general purpose
Read-ThroughCache fetches from DB on miss automaticallyORM-integrated caching, CDN origin fetch
Write-ThroughWrites go to cache AND DB synchronouslyRead-heavy with strong consistency
Write-BehindWrites go to cache, async flush to DBHigh write throughput, eventual consistency OK
Refresh-AheadCache proactively refreshes before expiryPredictable access patterns, low-latency critical
Cache-Aside Flow:

  App ──► Cache ──► HIT? ──► Return data
              │
              ▼ MISS
          Read DB ──► Store in Cache ──► Return data

Cache Invalidation

MethodConsistencyWhen to Use
TTL-basedEventual (up to TTL)Simple data, acceptable staleness
Event-basedStrong (near real-time)Inventory, profile updates
Version-basedStrongStatic assets, API responses, config
Tag-basedStrongCMS content, category-based purging

TTL Guidelines

Data TypeTTLRationale
Static assets (CSS/JS/images)1 year + cache-busting hashImmutable by filename
API config / feature flags30–60 secondsFast propagation needed
User profile data5–15 minutesTolerable staleness
Product catalog1–5 minutesBalance freshness vs load
Session dataMatch session timeoutSecurity requirement

HTTP Caching

Cache-Control Directives

DirectiveMeaning
max-age=NCache for N seconds
s-maxage=NCDN/shared cache max age (overrides max-age)
no-cacheMust revalidate before using cached copy
no-storeNever cache anywhere
must-revalidateOnce stale, must revalidate
privateOnly browser can cache, not CDN
publicAny cache can store
immutableContent will never change (within max-age)
stale-while-revalidate=NServe stale for N seconds while fetching fresh

Common Recipes

# Immutable static assets (hashed filenames)
Cache-Control: public, max-age=31536000, immutable

# API response, CDN-cached, background refresh
Cache-Control: public, s-maxage=60, stale-while-revalidate=300

# Personalized data, browser-only
Cache-Control: private, max-age=0, must-revalidate
ETag: "abc123"

# Never cache (auth tokens, sensitive data)
Cache-Control: no-store

Conditional Requests

MechanismRequest HeaderResponse HeaderHow It Works
ETagIf-None-Match: "abc"ETag: "abc"Hash-based — 304 if match
Last-ModifiedIf-Modified-Since: <date>Last-Modified: <date>Date-based — 304 if unchanged

Prefer ETag over Last-Modified — ETags detect content changes regardless of timestamp granularity.


Application Caching

SolutionSpeedShared Across ProcessesWhen to Use
In-memory LRUFastestNoSingle-process, bounded memory, hot data
RedisSub-ms (network)YesProduction default — TTL, pub/sub, persistence
MemcachedSub-ms (network)YesSimple key-value at extreme scale
SQLiteFast (disk)NoEmbedded apps, edge caching

Redis vs Memcached

FeatureRedisMemcached
Data structuresStrings, hashes, lists, sets, sorted setsStrings only
PersistenceAOF, RDB snapshotsNone
Pub/SubYesNo
Max value size512 MB1 MB
VerdictDefault choicePure cache at extreme scale

Distributed Caching

ConcernSolution
PartitioningConsistent hashing — minimal reshuffling on node changes
ReplicationPrimary-replica — writes to primary, reads from replicas
FailoverRedis Sentinel or Cluster auto-failover

Rule of thumb: 3 primaries + 3 replicas minimum for production Redis Cluster.


Cache Eviction Policies

PolicyHow It WorksWhen to Use
LRUEvicts least recently accessedDefault — general purpose
LFUEvicts least frequently accessedSkewed popularity distributions
FIFOEvicts oldest entrySimple, time-ordered data
TTLEvicts after fixed durationData with known freshness window
Redis default is noeviction. Set maxmemory-policy to allkeys-lru or volatile-lru for production.

Caching Layers

Browser Cache → CDN → Load Balancer → App Cache → DB Cache → Database
LayerWhat to CacheInvalidation
BrowserStatic assets, API responsesVersioned URLs, Cache-Control
CDNStatic files, public API responsesPurge API, surrogate keys
ApplicationComputed results, DB queries, external APIEvent-driven, TTL
DatabaseQuery plans, buffer pool, materialized viewsANALYZE, manual refresh

Cache Stampede Prevention

When a hot key expires, hundreds of requests simultaneously hit the database.

TechniqueHow It Works
Mutex / LockFirst request locks, fetches, populates; others wait
Probabilistic early expirationRandom chance of refreshing before TTL
Request coalescingDeduplicate in-flight requests for same key
Stale-while-revalidateServe stale, refresh asynchronously

Cache Warming

StrategyWhen to Use
On-deploy warm-upPredictable key set, latency-sensitive
Background jobReports, dashboards, catalog data
Shadow trafficCache migration, new infrastructure
Priority-basedLimited warm-up time budget
Cold start impact: A full cache flush can increase DB load 10–100x. Always warm gradually or use stale-while-revalidate.

Monitoring

MetricHealthy RangeAction if Unhealthy
Hit rate> 90%Low → cache too small, wrong TTL, bad key design
Eviction rateNear 0 steady stateHigh → increase memory or tune policy
Latency (p99)< 1ms (Redis)High → network issue, large values, hot key
Memory usage< 80% of maxApproaching max → scale up or tune eviction

NEVER Do

  1. NEVER cache without a TTL or invalidation plan — data rots; every entry needs an expiry path
  2. NEVER treat cache as durable storage — caches evict, crash, and restart; always fall back to source of truth
  3. NEVER cache sensitive data (tokens, PII) without encryption — cache breaches expose everything in plaintext
  4. NEVER ignore cache stampede on hot keys — one expired popular key can take down your database
  5. NEVER use unbounded in-memory caches in production — memory grows until OOM-killed
  6. NEVER cache mutable data with immutable Cache-Control — browsers will never re-fetch
  7. NEVER skip monitoring hit/miss rates — you won't know if your cache is helping or hurting

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

OpenClaw

86.86%
按下载量换算9,248

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

未展示

权限和风险

操作浏览器

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

安装前确认

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

来源信息

继续浏览同类 Skills