Skip to content
Back to skills

Caching Http

ASecurity

Configure HTTP and CDN caching accurately using Cache-Control, ETag, Vary, immutable assets, and safe invalidation

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmentapiperformance

Works with

  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill caching-http --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Caching Http?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Caching Http
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-caching-http/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-caching-http)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Configure HTTP and CDN caching accurately using Cache-Control, ETag, Vary, immutable assets, and safe invalidation
profile: standard
tags: http, caching, performance, web
---

# HTTP caching

Use when setting response headers, CDN cache rules, or conditional requests on APIs and web assets.

## Directives and headers
- Serve content-hashed static assets with `Cache-Control: public, max-age=31536000, immutable` and HTML/entry documents with `no-cache` or short `s-maxage` + `stale-while-revalidate`.
- Mark personalized or authenticated JSON responses `Cache-Control: private, no-store` (or `private, max-age=...`) so shared CDNs never leak user data across callers.
- Set accurate `Vary` headers (e.g., `Accept-Encoding`, `Origin`) without keying on high-cardinality headers like raw `User-Agent` or `Cookie`.

## Validation and purging
- Emit strong `ETag` or `Last-Modified` validators on read-heavy endpoints and honor `If-None-Match` with `304 Not Modified`.
- Use surrogate keys (`Cache-Tag`) or versioned cache prefixes for instant invalidation when mutations happen.

## Verify
Inspect raw `curl -I` response headers, test `If-None-Match` -> `304`, and confirm authenticated responses are never stored publicly.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.