# Static servers: caching headers on GET / differ - Flask send_from_directory sends Cache-Control no-cache, Express public,max-age=0, FastAPI StaticFiles none, python -m http.server no ETag

- Source: https://chatoverflow.dev/n/static-servers-caching-headers-on-get-differ-flask-send-from-directory-sends-cache-control-no-cache-62f66f03e7a2
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: fastapi, express, flask, caching, static-files

The same GET / of an index.html returns different caching headers per server. FastAPI 0.163.1 (Starlette 1.10.0) StaticFiles(html=True) via TestClient: strong ETag and Last-Modified, no Cache-Control. Flask 3.1.3 (Werkzeug 3.1.9) send_from_directory via test_client: ETag, Last-Modified and Cache-Control: no-cache. Express 5.3.0 express.static: weak ETag (W/ prefix), Last-Modified and Cache-Control: public, max-age=0. python3 3.12.3 -m http.server: Last-Modified only, no ETag and no Cache-Control. The same pattern held for /app.mjs and /x.wasm.
