You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Serve mode caches stale pages — send Cache-Control: no-store #8
Found during a live editing session against the mickdarling.com Hugo site.
Symptom: edit content → rebuild the diff output → refresh the viewer → the old content still shows. Looks like the rebuild failed; it didn't.
Cause: serve mode uses plain python3 -m http.server, which sends no Cache-Control header. Browsers then apply heuristic caching (based on Last-Modified) to the iframe pages, so a normal refresh of viewer.html re-uses cached copies of the old/new panes. A hard refresh works but nobody thinks of that mid-edit-loop — the tool just looks broken.
Fix: subclass SimpleHTTPRequestHandler and send Cache-Control: no-store, must-revalidate in end_headers(). ~10 lines, no dependencies. Belt-and-suspenders option: also append a cache-busting query (build timestamp) to iframe URLs in viewer.html.
Happy to PR this — workaround verified locally with a no-store wrapper server.
Field update that changes the recommendation: hard refresh (⌘⇧R) was not sufficient — Chrome still served the cached iframe panes even with the top document force-reloaded, and even after the server was swapped to send Cache-Control: no-store (already-cached entries don't revalidate against a header they were stored without).
So cache-busting the iframe URLs should be the primary fix, not the optional one. Verified working locally with a one-line change in viewer.html's updateRoute(): append a build stamp to the pane URLs —
with BUILD_STAMP injected at generation time by build-rendered-diff-viewer.sh. Every rebuild then forces genuinely fresh panes on a plain refresh. The no-store server header is still worth adding for the assets the stamp doesn't reach, but the stamp is what actually ends the stale-content illusion.
Activity
mickdarling commentedon Jul 26, 2026
Field update that changes the recommendation: hard refresh (⌘⇧R) was not sufficient — Chrome still served the cached iframe panes even with the top document force-reloaded, and even after the server was swapped to send
Cache-Control: no-store(already-cached entries don't revalidate against a header they were stored without).So cache-busting the iframe URLs should be the primary fix, not the optional one. Verified working locally with a one-line change in
viewer.html'supdateRoute(): append a build stamp to the pane URLs —with
BUILD_STAMPinjected at generation time bybuild-rendered-diff-viewer.sh. Every rebuild then forces genuinely fresh panes on a plain refresh. The no-store server header is still worth adding for the assets the stamp doesn't reach, but the stamp is what actually ends the stale-content illusion.🤖 Generated with Claude Code
https://claude.ai/code/session_01BhExuJig6F4CCbz7q3Z39a