Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add cass-2003/local-workflow-skill --skill http-cachinggit clone --depth 1 https://github.com/cass-2003/local-workflow-skillWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/cass-2003/local-workflow-skill/http-caching)<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/http-caching"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/http-caching/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/http-caching"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/http-caching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00151 | $0.03136 |
| Opus 5.5 | $0.00060 | $0.01254 |
| Sonnet 5.5 | $0.00030 | $0.00627 |
| Haiku 4.5 | $0.00015 | $0.00314 |
Grade A, and why
http-caching scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
caches.match(e.request).then(r => r || fetch(e.request).then(resp => { How it starts
The opening of the file, as written. The whole thing — 329 lines — stays where its author put it; the contents beside it link to each section on GitHub.
HTTP Caching Skill — 全栈缓存实战
何时使用
- 设计 API / 静态资源缓存策略
- 排查"为什么 CDN 没命中" / "为什么改了内容浏览器还显示旧版"
- 优化 TTFB / Core Web Vitals 中 LCP
- 评审静态资源构建产物的 cache header
- 实现 cache invalidation(部署后旧缓存失效)
一、缓存层级(从近到远)
[ Browser Memory Cache ] ← 最快,关闭 tab 丢失
↓
[ Browser Disk Cache ] ← 持久,跨会话
↓
[ Service Worker Cache ] ← 可编程,离线能力
↓
[ ISP / Corporate Proxy ] ← 共享缓存
↓
[ CDN Edge ] ← 全球分发,TTL 可控
↓
[ Reverse Proxy (nginx) ] ← 应用前端
↓
[ Application Memory ] ← 进程内 LRU
↓
[ Distributed Cache (Redis) ] ← 跨实例共享
↓
[ Database ] ← 持久层
每一层都受 HTTP header 控制(除 app 内存 / Redis 是程序自管)。
二、Cache-Control 指令完全清单
Cache-Control: public, max-age=3600, s-maxage=86400, stale-while-revalidate=600, must-revalidate
| 指令 | 含义 |
|---|---|
public |
任何缓存(包括 CDN / proxy)都可存 |
private |
仅浏览器可存(不可 CDN) |
no-cache |
可存但每次必须先验证(条件请求) |
no-store |
绝对不存 — 用于敏感数据 |
max-age=N |
浏览器缓存 N 秒 |
s-maxage=N |
CDN / shared cache 缓存 N 秒(覆盖 max-age) |
must-revalidate |
过期后必须验证,不可用 stale |
proxy-revalidate |
同上但仅对 shared cache |
immutable |
客户端不要做条件请求(带 hash 文件名时用) |
stale-while-revalidate=N |
过期后 N 秒内可返回 stale,后台异步更新 |
stale-if-error=N |
上游错误时可返回 stale N 秒 |
三、四种典型策略
1. 不可变文件(带 hash 文件名)
Cache-Control: public, max-age=31536000, immutable
bundle.a1b2c3.js — 1 年缓存,永不验证。文件变了 hash 也变了,URL 变了浏览器自然取新。
2. HTML 入口
Cache-Control: no-cache
每次必须验证。配合 ETag 实现 "未变 304",变了拉新版(带新 hash 的 bundle 引用)。
3. API 响应(频繁更新)
Cache-Control: private, max-age=0, must-revalidate
或者用 ETag 节省带宽:
Cache-Control: private, max-age=60
ETag: "W/abc123"
4. CDN 强缓存 + SWR
Cache-Control: public, max-age=60, s-maxage=86400, stale-while-revalidate=600
- 浏览器:60s 内不发请求
- CDN:1 天内直接返回;过期后再 10 分钟可返 stale 同时后台更新
- 实际命中率极高,源站压力极低
四、ETag / Last-Modified 协商缓存
服务端响应:
HTTP/1.1 200 OK
ETag: "v3-abc123"
Last-Modified: Wed, 06 May 2026 06:00:00 GMT
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 329 lines · 151 tokens per session scan A 43a5295916d9
http-caching is a skill published in the GitHub repository cass-2003/local-workflow-skill (12 stars, last pushed 4mo ago), licensed MIT. It adds 151 tokens to every session and 3,136 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
http-caching compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| http-cachingcass-2003/local-workflow-skill | Skill | 12 | 4mo ago | MIT | A | 151 | Claude Code, Codex |
| web-designcountbot-ai/CountBot | Skill | 788 | 9d ago | MIT | A | 81 | Claude Code, Codex |
| huawei-cloud-obs-website-hosthuaweicloud/huaweicloud-skills | Skill | 67 | today | MIT | A | 129 | Claude Code, Codex |
| configure-cache-bustinglaurigates/claude-plugins | Skill | 60 | today | MIT | A | 39 | Claude Code |
| kirby-performance-and-mediabnomei/kirby-mcp | Skill | 74 | 4d ago | MIT | A | 37 | Claude Code, Codex |
| publish-websiteoborseth/Porkbun-MCP | Skill | 38 | today | MIT | A | 65 | Claude Code |
| scaffoldcoroboros/agent-skills | Skill | 5 | yesterday | MIT | A | 45 | Claude Code |