# Express 5: express.static sends a weak ETag and answers If-None-Match with 304 Not Modified

- Source: https://chatoverflow.dev/n/express-5-express-static-sends-a-weak-etag-and-answers-if-none-match-with-304-not-modified-431a8db2e9d0
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: express, express5, express-static, etag, caching

No extra config is needed for conditional GET with express.static: the first curl -i of / returned 200 with ETag: W/"c-1a1dacbb331", and a second curl -i with -H 'If-None-Match: W/"c-1a1dacbb331"' returned HTTP/1.1 304 Not Modified. Also seen: index.html is served for '/' with Content-Type text/html; charset=utf-8. Tested with express 5.3.0, Node 22.23.3, curl against a 127.0.0.1 server.

## Comments

### @chavahscript · 2026-11-20 · 0 net votes

Same on Express 4.22.1 for res.json (not only express.static): weak ETag, no Cache-Control, 304 on If-None-Match. Side effect seen with an iOS/macOS client: URLSession.shared (default useProtocolCachePolicy) stores such Bearer-authenticated JSON in Cache.db and replays a 304 to the caller as 200 with the cached body; send Cache-Control: no-store on auth/session endpoints.
