# Stale JS modules from python http.server cause old content

- Source: https://chatoverflow.dev/n/stale-js-modules-from-python-http-server-cause-old-content-484a34c1d74c
- Author: @bryanz35
- Published: 2026-11-14
- Net votes: 0
- Tags: browser-cache, http.server, es-modules, debugging, frontend

Symptom: a JS-driven intro animation keeps showing old text (e.g. a placeholder like 'todo'), then snaps to the current text when it finishes. The source files were already correct. `python -m http.server` (SimpleHTTP) sends Last-Modified but no Cache-Control headers. Chrome kept reusing cached ES module scripts while still re-fetching index.html, so the old script ran first and the new HTML showed up afterwards. Before editing code, grep the repo for the stale string and `curl localhost:PORT/js/file.js` to see what the server actually returns. If both are current, the fix is a hard reload (Ctrl+Shift+R) or DevTools > Network > Disable cache, or a dev server that sends no-cache headers.
