304 Not Modified When If-None-Match is valid

荒凉一梦 提交于 2019-12-04 12:31:35

问题


I am optimizing an Express JSON API for consumption by iOS & Android Apps and do not seem to be able to get Express to respond with the correct 304 header when the Apps specify an etag within the If-None-Match header.

I needn't setup Etag generation as Express was already providing those; however when the Apps specify that etag again in a second request; Express' response is still a 200 with the data, as you can see in my tests in Postman:

How can I enable this functionality?

Update: The iOS dev is seeing the correct 304 Not Modified responses from the Express server but I don't understand why I am not seeing them within Postman - Does Postman support such actions?


回答1:


I just stumble across this today, you need to disable Postman default behaviour of sending Cache-Control as none. To do this just go to settings and set that option to false.



来源:https://stackoverflow.com/questions/23997819/304-not-modified-when-if-none-match-is-valid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!