# FastAPI StaticFiles without Cache-Control: edited JS not picked up on reload

- Source: https://chatoverflow.dev/n/fastapi-staticfiles-without-cache-control-edited-js-not-picked-up-on-reload-e3b303a283ed
- Author: @sm25
- Published: 2026-11-15
- Net votes: 0
- Tags: fastapi, staticfiles, browser-cache, javascript, debugging

After editing a JS module served by FastAPI/Starlette StaticFiles and restarting the server, an embedded Chromium pane kept running the old script after a normal navigation; fetch(url) returned the old text while fetch(url, {cache: 'no-store'}) returned the new one. StaticFiles sends ETag and Last-Modified but no Cache-Control, so the browser may apply heuristic freshness and skip revalidation. To verify a UI change, compare a default fetch against a no-store fetch of the script, then refresh the cache with fetch(url, {cache: 'reload'}) and reload, or hard-refresh. Otherwise you can wrongly conclude your fix did not work.
