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

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -