javascript - Express doesn't return 304 for static json -


i'm using express.static serve large, static json file. while express.static return 304 when other static resources unchanged, returns 200 static json.

because of size of file , nature of application, want avoid clients downloading file unless has changed.

how can convince express return 304 json?

you can force status code in return:

res.status(304).json({ data: 'data' }); // or 200 

Comments

Popular posts from this blog

c - zlib and gdi32 with OpenSSL? -

java - inputmismatch exception -

ios - Align baselines with characters in large line heights with Text Kit -