You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.
Implement a strategy whereby HEAD requests are tried first, so that the resource body isn't downloaded since a lot of desired information is generally in the response headers anyway.
There are instances where this is not the case. For example, if chunked transfer encoding is used, the size of the resource won't be available. While most responses should include a content type header, it's possible they may not. Finally, some resources won't support HEAD (in which case a 405 response should be returned). So, use GET as a fallback in cases where desired information isn't available in HEAD responses.
(Originally opened by @elazar on a different repo, moving issue to this rep)
The text was updated successfully, but these errors were encountered:
GET requests can fetch large resources that consume lots of bandwidth unnecessarily.
Example:
Implement a strategy whereby HEAD requests are tried first, so that the resource body isn't downloaded since a lot of desired information is generally in the response headers anyway.
There are instances where this is not the case. For example, if chunked transfer encoding is used, the size of the resource won't be available. While most responses should include a content type header, it's possible they may not. Finally, some resources won't support HEAD (in which case a 405 response should be returned). So, use GET as a fallback in cases where desired information isn't available in HEAD responses.
(Originally opened by @elazar on a different repo, moving issue to this rep)
The text was updated successfully, but these errors were encountered: