http-caching

http-caching is a skill for Claude Code, Codex from cass-2003/local-workflow-skill. It costs 151 tokens per session (3,136 once invoked), scanned A, original, MIT.

A guide to HTTP caching, which stores web responses closer to users so they can be reused instead of fetched again. It covers browser caches, CDNs, reverse proxies, and API responses.

In plain words
What is it for?
Use it to set Cache-Control, ETag, and related headers, design CDN policies, improve loading performance, and invalidate old files after deployment.
Why use it?
It helps pages and APIs respond faster while preventing users or CDNs from showing outdated content.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to set Cache-Control, ETag, and related headers, design CDN policies, improve loading performance, and invalidate old files after deployment.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cass-2003/local-workflow-skill/http-caching
Install

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.

Any agent
npx skills add cass-2003/local-workflow-skill --skill http-caching
Clone the repo
git clone --depth 1 https://github.com/cass-2003/local-workflow-skill

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for http-caching

README.md
[![agentmods](https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/http-caching/github.svg)](https://agentmods.dev/skills/cass-2003/local-workflow-skill/http-caching)
Your own site
<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.

agentmods 80×15 button for http-caching

Your own site · 80×15
<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>
Per session 151 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,136 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00151 $0.03136
Opus 5 $0.00076 $0.01568
Sonnet 5 $0.00030 $0.00627
Haiku 4.5 $0.00015 $0.00314

Measured 7d ago against content hash 43a5295916d9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

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 7d 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 => {
skills/engineering-core/ours/http-caching/SKILL.md · 329 lines

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

Read the full file on GitHub · 329 lines

Changes

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.

  1. 7d ago First seen · 329 lines · 151 tokens per session scan A 43a5295916d9

Subscribe to this mod's changes

http-caching is a skill published in the GitHub repository cass-2003/local-workflow-skill (12 stars, last pushed 2mo ago), licensed MIT. It adds 151 tokens to every session and 3,136 once invoked, about $0.0008 per session on Opus 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.

Related

Other skills, from other repositories

web-design

A tool for designing and publishing single-page HTML websites, such as reports, landing pages, and data displays. It uses common web libraries for layouts, charts, icons, and responsive pages, then can deploy the result to Cloudflare Pages.

countbot-ai/CountBot · 81 tokens

huawei-cloud-obs-website-host

Configure Huawei Cloud OBS static website hosting with Python SDK and a custom domain. Use when the user needs to enable or repair OBS website hosting, set index or error pages, expose an existing bucket for public website access through a custom domain, or connect that domain through Huawei Cloud DNS when Huawei…

huaweicloud/huaweicloud-skills · 129 tokens

configure-cache-busting

Cache-busting for Next.js and Vite: content hashing, CDN cache headers. Use when adding Vercel/Cloudflare cache headers or auditing static asset caching.

laurigates/claude-plugins · 39 tokens

kirby-performance-and-media

Improves Kirby performance and media delivery (cache tuning, CDN, responsive images, lazy loading). Use when optimizing page speed, caching, or image handling.

bnomei/kirby-mcp · 37 tokens

saas-funnel-cloning

Clone landing pages and funnels from SaaS builders (GoHighLevel, ClickFunnels, etc.) into standalone static HTML, then deploy to GitHub + Vercel. Covers extraction, reconstruction, and deployment.

S3YED/appie-kit · 49 tokens

clark-work

Use when you (a Clark agent) must read or update the customer's work in Clark Work, or create projects/tasks. Covers picking up tasks the customer put on the To Do board and creating your own projects and tasks.

S3YED/appie-kit · 48 tokens