fix(sim): revalidate /media instead of pinning it immutable
The `immutable, max-age=1y` media header pinned stale footage in the browser for a year, so a re-sourced or re-cropped clip (e.g. the de-captioned cosmos) never showed without a manual cache clear. Switch /media to `no-cache` (store, but revalidate every load): instant altitude swaps already come from the in-memory blob preload, so the HTTP cache only matters on (re)load — where a conditional request is a cheap 304 when unchanged but picks up edited clips immediately. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -113,8 +113,11 @@ def test_media_is_cacheable(tmp_path, monkeypatch):
|
||||
resp = client.get("/media/cosmos/base.mp4")
|
||||
assert resp.status_code == 200
|
||||
cc = resp.headers.get("cache-control", "")
|
||||
# Stored but revalidated: not no-store (so the blob preload can cache it), and
|
||||
# not pinned immutable (so a re-sourced/re-cropped clip shows on a plain reload).
|
||||
assert "no-store" not in cc
|
||||
assert "max-age" in cc
|
||||
assert "immutable" not in cc
|
||||
assert "no-cache" in cc
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
Reference in New Issue
Block a user