Skip to content

chore(routes): enforce no-cache policy on agent-updatable file routes#317

Merged
MCERQUA merged 2 commits into
devfrom
feat/enforce-no-cache-policy
May 19, 2026
Merged

chore(routes): enforce no-cache policy on agent-updatable file routes#317
MCERQUA merged 2 commits into
devfrom
feat/enforce-no-cache-policy

Conversation

@MCERQUA
Copy link
Copy Markdown
Owner

@MCERQUA MCERQUA commented May 19, 2026

Summary

Adds explicit Cache-Control: no-cache, no-store, must-revalidate + CDN-Cache-Control: no-store headers to the four routes that serve agent-updatable content. Fixes live-updates regressions where icon swaps / canvas-page media / workspace files / upload edits weren't visible until a hard refresh.

Scope:

  • routes/canvas.py — canvas-pages non-HTML media (previously max_age=3600 + CDN cache; now no-store end-to-end)
  • routes/icons.py — Lucide icon library endpoint
  • routes/static_files.py/uploads/<path> (known_faces excluded — has its own route)
  • routes/workspace.py — workspace raw file endpoint

Streaming preserved: conditional=True and Accept-Ranges: bytes stay in place, so audio/video range requests still work for playback.

Reasoning

OpenVoiceUI is a live agentic surface — agents/admins continuously write canvas pages, icons, generated images, workspace files, JSON state. Cached responses defeat the "live updates always visible" guarantee. Full policy doc (Mike's verbatim rule, scope, exceptions, rollback) lives at docs/jambot/no-cache-policy.md in the MIKE-AI ops repo.

Rollback

Single commit — git revert 97f3d3e reverts all 4 file changes atomically. Each route's prior cache behavior is restored exactly (the diff only adds headers + drops one max_age=3600 from canvas.py).

Mike and others added 2 commits May 19, 2026 21:49
Live-updates regressions on 2026-05-18 traced to browser/CDN caching of
icons, canvas-page media, workspace files, and uploads. Adds explicit
Cache-Control/Pragma/Expires + CDN-Cache-Control no-store headers to
the four routes that serve agent-updatable content:

- routes/canvas.py     — canvas-pages non-HTML media (was max_age=3600)
- routes/icons.py      — Lucide icon library (agents may swap icons)
- routes/static_files.py — /uploads/ (excludes known_faces, which has its
                            own route)
- routes/workspace.py  — workspace raw file endpoint

conditional=True and Accept-Ranges are preserved so audio/video streaming
still works correctly. Reasoning, scope, and rollback live in
docs/jambot/no-cache-policy.md (committed separately to the MIKE-AI ops
repo).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MCERQUA MCERQUA merged commit b6f08f5 into dev May 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant