Repository navigation
Description
Symptom
After PR #54 fixed #53 (failure-fallback HTML no longer cached with SWR=86400), datasets that were poisoned before the fix shipped continue to render the empty-fallback HTML for up to 24 h per Cloudflare PoP. User report 2026-05-26: on005505 still shows "No description available" / "Manifest unavailable" even though the underlying data.nemar.org artifacts are healthy and a cache-bust (?_cb=...) returns full content.
Root cause
src/middleware.ts:69-101 writes 200 responses to caches.default under namespace nemar-edge-v1, honoring the upstream Cache-Control. Pre-#54 fallback responses got s-maxage=600, stale-while-revalidate=86400 and are still served as HIT from any PoP that cached them in that window. There's no mechanism to invalidate them on deploy or on demand.
Proposal
Pick one (or layer):
- Versioned cache namespace — bump
caches.default.open(\"nemar-edge-v1\")to\"nemar-edge-v2\"on every meaningful change to the cache-policy or partial logic. Old namespace just goes cold. Cheapest, automatic on next deploy. - Cache-bust script — operational utility (
scripts/bust-edge-cache.ts) that walksapi.nemar.org/datasets, fires cache-busting GETs against each/dataset/<id>page + both partials. Run manually after large coverage changes. - CF Purge API — wire the Cloudflare zone purge into the deploy step. Heaviest, but exact.
Recommend (1) as the default for code/policy changes, (2) for ops follow-up after a fleet-wide content event (like today's on* re-import where summary.json coverage went from incomplete to nearly-complete).
Companion: bust the current poisoned set
Independent of the long-term fix, the user-visible bug today needs the existing poisoned entries flushed. A one-shot run of option (2) against the 123 on*+nm* ids would resolve the immediate symptom; no code change required.
Acceptance
- After deploy, no dataset can serve cached fallback HTML older than the SWR window of the policy that was active when it was stored
- Documented runbook step for option (2) lives in
README.mdordocs/ - Verified: cache-busting a known-poisoned dataset evicts the entry from the PoP the request hits
Related
- Closed: fix(api): don't cache failure-fallback HTML on tree/readme partials #53 (forward fix), fix(api): no-store on tree/readme empty-fallback branches #54 (PR)
- Reported in nemar-cli memory note
website_partial_cache_poisoning2026-05-23, re-confirmed 2026-05-26 on on005505
Activity
review(#65): fix partial paths in namespace comment
Merge pull request #67 from nemarOrg/feature/issue-65-edge-cache-v2