- Home
- Skills
- APIs & Backend
- Repair HTTP Cache Revalidation Bugs
More screenshots
Works with the AI tools you already use
Repair HTTP Cache Revalidation Bugs
Diagnose and repair HTTP cache revalidation, validators, 304 responses, Vary behavior, and cache freshness.
$8.99
Repair HTTP Cache Revalidation Bugs
Example session with this skill installed
Our Node.js API is returning 200 OK for every request even when the client sends If-None-Match. The ETag is generated from the DB version string. Why is revalidation failing?
- Read your context and instructions
- Compiled the repair http cache
I have analyzed your ETag revalidation flow. The issue stems from a mismatch between the quoted ETag string expected by HTTP semantics and the raw version string being compared in your middleware, coupled with a missing 304 status assignment.
Cache Revalidation Diagnosis & Fix
| Component | Status | Observation |
|---|---|---|
| ETag Generation | Valid | Uses DB versioning, which is a reliable source of truth. |
| Header Parsing | Failed | Middleware is comparing if-none-match against version without handling double quotes. |
| Response Logic | Failed | Logic falls through to the main controller instead of short-circuiting with a 304. |
Proposed Repair (Node.js/Express)
app.use((req, res, next) => {
const resourceVersion = getResourceVersion(); // e.g., "v123"
const etag = `"${resourceVersion}"`; // ETags must be wrapped in quotes
res.setHeader('ETag', etag);
res.setHeader('Cache-Control', 'public, no-cache'); // Force revalidation
const ifNoneMatch = req.headers['if-none-match'];
// Repair: Handle weak ETags and quoted string comparison
if (ifNoneMatch === etag || ifNoneMatch === `W/${etag}`) {
// Critical: You must set the status AND end the response
return res.status(304).end();
}
next();
});
Next steps
- Verify if your CDN (e.g., Cloudflare) is stripping the ETag header due to specific "Email Obfuscation" or "Rocket Loader" settings.
- Run a
curl -I -H 'If-None-Match: "v123"' https://api.example.com/resourcetest to confirm the 304 response. - Ensure the
Varyheader includesAccept-Encodingif your ETag changes based on compression.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
Repair HTTP Cache Revalidation Bugs targets production and repository defects around diagnose and repair HTTP cache revalidation, validators, 304 responses, Vary behavior, and cache freshness.. It examines ETag strength and generation, If-None-Match and If-Modified-Since precedence, 304 response metadata, Vary and authorization/tenant dimensions, stale-while-revalidate behavior, proxy/CDN versus application cache ownership, content encoding and validator consistency, cache invalidation tests and observability, then establishes one explicit repair contract and focused deterministic validation.
The skill works from repository access or partial evidence such as snippets, logs, configuration, traces, and architecture notes. It preserves existing product/security policy, avoids invented execution claims, and keeps production systems, real credentials, and deployment outside the validation path.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 1 month ago
- Passed all security checks, Safe to install