http HEAD vs GET performance

后端 未结 8 793
无人共我
无人共我 2020-11-30 17:57

I am setting-up a REST web service that just need to answer YES or NO, as fast as possible.

Designing a HEAD service seems the best way to do it but I would like to

8条回答
  •  时光取名叫无心
    2020-11-30 18:44

    You could easily make a small test to measure the performance yourself. I think the performance difference would be negligable, because if you're only returning 'Y' or 'N' in the body, it's a single extra byte appended to an already open stream.

    I'd also go with GET since it's more correct. You're not supposed to return content in HTTP headers, only metadata.

提交回复
热议问题