recovering-poisoned-asset-cache

Diagnose and recover cached 404s on CDN-served frontend asset chunks.

2.0k|679|Updated Jun 13, 2024
One-click install
npx skills add https://github.com/Comfy-Org/ComfyUI_frontend --skill recovering-poisoned-asset-cache
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: recovering-poisoned-asset-cache
Source: https://github.com/Comfy-Org/ComfyUI_frontend/tree/main/.claude/skills/recovering-poisoned-asset-cache
Command: npx skills add https://github.com/Comfy-Org/ComfyUI_frontend --skill recovering-poisoned-asset-cache

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Users get stuck on a blank page or endless splash screen when a CDN or browser caches a 404 for a content-hashed JavaScript boot chunk, and reloading cannot fix it because the client never revalidates the cached response.

Core Features & Use Cases

  • Diagnosis confirmation: Distinguish a poisoned cache (404 with cf-cache-status HIT) from a genuinely missing origin file or an unrelated boot failure using curl header probes.
  • Three-layer remediation: Apply the origin-side nginx no-store fix for 4xx/5xx responses, purge poisoned URLs at the Cloudflare edge, and understand why server-side fixes cannot reach clients holding immutable cached 404s.
  • Asset URL rotation: Set the ASSET_CACHE_BUST repository variable so every emitted asset filename changes across all subsequent builds, since a plain redeploy leaves vendor chunk filenames byte-identical.
  • Use Case: After a deploy, users report "spinner forever" and curl shows a cached 404 on rolldown-runtime-*.js; follow the runbook to confirm the poisoning, purge the edge, bump ASSET_CACHE_BUST to today's date, and verify recovery via curl and RUM.

Quick Start

Ask the assistant to diagnose whether users stuck on the splash screen are hitting a cached 404 on a boot asset and walk through the recovery steps.

Frequently Asked Questions about recovering-poisoned-asset-cache

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix users stuck on a blank page after a frontend deploy?

First confirm whether a boot asset is returning a cached 404 by running curl -sI on the chunk URL and checking for HTTP 404 with cf-cache-status: HIT. If confirmed, purge the poisoned URLs at the CDN edge and rotate asset filenames so affected clients fetch new URLs.

Why doesn't redeploying fix a cached 404 on a JavaScript chunk?

Content hashes only change when file content changes, and vendor chunks like rolldown-runtime or vendor-vue-core come from node_modules, which a commit does not alter. Measured builds showed only 153 of 495 chunks rotating, leaving the poisoned vendor URLs identical after redeploy.

How do I force all asset filenames to change in a Vite or rolldown build?

Set the ASSET_CACHE_BUST repository variable to a date like 20260818, which the build pipeline inserts into every emitted asset filename. This rotates all 495 hashed JS and CSS URLs while leaving non-hashed static files like favicon.ico unchanged.

Can a server-side fix reach users whose browser cached a 404 with immutable?

No. A browser holding Cache-Control: max-age=2592000, immutable for a 404 will not revalidate, so no origin or edge action reaches that client. Only changing the asset URL itself, via a filename salt, forces the browser to request a fresh resource.

Why does RUM show no errors during a boot chunk 404 incident?

If a boot chunk 404s, no JavaScript executes, so no in-app error reporter ever fires and the error chart stays flat. Confirm recovery from the server side instead by monitoring the 404 rate on /assets/* requests.

What are the limitations of the ASSET_CACHE_BUST filename rotation?

It only affects content-hashed assets; non-hashed static files like favicon.ico, images, and CREDIT.txt keep their URLs. Also, the variable must never be cleared once set, because reverting restores the exact poisoned filenames and breaks clients still holding those cache entries.