Spaces:
Running
Running
Commit History
Yesterday
-
Send cache headers so updates reach visitors on a normal reload
Verified signature## What Cache headers for the demo's files. `server.py` replaces `python -m http.server`: the page, scripts and data (`index.html`, `worker.js`, `pybot_web.py`, `tree.json`) get `Cache-Control: no-cache`; the bot bundle gets `immutable`, the fonts one day. ## Why After #2 was merged, Lewis's browser kept the old `index.html` and paired it with the new `tree.json`, so file links had the new commit but no line numbers. `http.server` sends no `Cache-Control`, so browsers may reuse a page heuristically after an update. ## How - `no-cache` still lets browsers keep a copy, but they check it on every load. An unchanged file costs a 304 (`http.server` already handles `If-Modified-Since`). - The bundle can be cached for good because its name changes with every build (`pybot-<sha12>-<hash>.zip`). - `Dockerfile` runs `server.py` (port 7860 as before; `HOST`/`PORT` can be overridden for local tests). README updated. ## Testing Served the live files locally with `server.py`: the headers are as a…445c84c