Skip to content

Commit 89835e4

Browse files
Julien-Dochezhamishwilleegithub-actions[bot]Josh-Cena
authored
docs (content-length) : Add HTTP version comparison (mdn#40534)
* docs (content-length) : Add HTTP version comparison - Add comparison between HTTP/1.1 and HTTP/2 behaviors - Addresses issue mdn#36681 * Update files/en-us/web/http/reference/headers/content-length/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update files/en-us/web/http/reference/headers/content-length/index.md * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Apply suggestions from code review * Update files/en-us/web/http/reference/headers/content-length/index.md Co-authored-by: Joshua Chen <sidachen2003@gmail.com> * MOve to description --------- Co-authored-by: Hamish Willee <hamishwillee@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
1 parent 099a15b commit 89835e4

File tree

1 file changed

+6
-0
lines changed
  • files/en-us/web/http/reference/headers/content-length

1 file changed

+6
-0
lines changed

files/en-us/web/http/reference/headers/content-length/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ sidebar: http
99

1010
The HTTP **`Content-Length`** header indicates the size, in bytes, of the message body sent to the recipient.
1111

12+
`Content-Length` is limited in that the message size must be known up front, before sending the headers, which is a problem when content is dynamically generated or streamed.
13+
14+
- In HTTP/1.0, it is required.
15+
- In HTTP/1.1, it could be replaced with {{httpheader("Transfer-Encoding", "Transfer-Encoding: chunked")}} for responses sent out in parts as its size is calculated.
16+
- In HTTP/2, `Content-Length` is redundant, because the content length may be inferred from DATA frames. It may still be included for backwards compatibility.
17+
1218
<table class="properties">
1319
<tbody>
1420
<tr>

0 commit comments

Comments
 (0)