From 9db11878780e8712ecac5e3712b2955bc5b79d27 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Mon, 13 Jul 2026 14:59:47 -0700 Subject: [PATCH] whistlegraph.org: revalidate graphs.json/posts.json (fix stale curation) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both data files are served max-age=3600, stale-while-revalidate=86400, so a returning visitor's browser kept a stale copy for up to an hour after each deploy — every fold/rename/attribution stayed invisible until it expired (Alex not seeing folded-in posts). Fetch them with cache:'no-cache' so the browser revalidates against the server every load. index.html is already no-cache, so the fix reaches existing visitors on their next view. --- system/public/whistlegraph.org/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/public/whistlegraph.org/index.html b/system/public/whistlegraph.org/index.html index 5c7f35042c..3e294240ae 100644 --- a/system/public/whistlegraph.org/index.html +++ b/system/public/whistlegraph.org/index.html @@ -499,13 +499,15 @@ function renderReset(scrollTop){ let postsLoaded=null; function loadPosts(){ if(postsLoaded) return postsLoaded; - postsLoaded=fetch("/posts.json").then(r=>r.ok?r.json():{posts:[]}).then(pd=>{ + postsLoaded=fetch("/posts.json",{cache:"no-cache"}).then(r=>r.ok?r.json():{posts:[]}).then(pd=>{ for(const p of pd.posts||[]) for(const code of p.graphs||[]) (POSTS_BY_CODE[code]||=[]).push(p); }).catch(()=>{}); return postsLoaded; } -fetch("/graphs.json").then(r=>r.json()).then(data=>{ +// no-cache: the curation changes constantly (folds, renames, attributions) — the +// browser must revalidate so a stale max-age copy never hides a fresh deploy. +fetch("/graphs.json",{cache:"no-cache"}).then(r=>r.json()).then(data=>{ GRAPHS=data.graphs; CURATED_N=data.curated; COMPOSITIONS=GRAPHS.slice(); EXPERIMENTS=GRAPHS.filter(w=>w.kind==="experiment"); -- 2.51.2