<s>
Chunked	B-Protocol
transfer	I-Protocol
encoding	I-Protocol
is	O
a	O
streaming	B-Architecture
data	O
transfer	O
mechanism	O
available	O
in	O
Hypertext	B-Protocol
Transfer	I-Protocol
Protocol	I-Protocol
(	O
HTTP	B-Protocol
)	O
version	O
1.1	O
,	O
defined	O
in	O
RFC	O
9112	O
§	O
7.1	O
.	O
</s>
<s>
In	O
chunked	B-Protocol
transfer	I-Protocol
encoding	I-Protocol
,	O
the	O
data	O
stream	O
is	O
divided	O
into	O
a	O
series	O
of	O
non-overlapping	O
"	O
chunks	O
"	O
.	O
</s>
<s>
Chunked	B-Protocol
transfer	I-Protocol
encoding	I-Protocol
is	O
not	O
supported	O
in	O
HTTP/2	B-Protocol
,	O
which	O
provides	O
its	O
own	O
mechanisms	O
for	O
data	O
streaming	B-Architecture
.	O
</s>
<s>
The	O
introduction	O
of	O
chunked	B-Protocol
encoding	I-Protocol
provided	O
various	O
benefits	O
:	O
</s>
<s>
Chunked	B-Protocol
transfer	I-Protocol
encoding	I-Protocol
allows	O
a	O
server	O
to	O
maintain	O
an	O
HTTP	B-Protocol
persistent	I-Protocol
connection	I-Protocol
for	O
dynamically	O
generated	O
content	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
the	O
HTTP	B-Protocol
Content-Length	O
header	O
cannot	O
be	O
used	O
to	O
delimit	O
the	O
content	O
and	O
the	O
next	O
HTTP	B-Protocol
request/response	O
,	O
as	O
the	O
content	O
size	O
is	O
not	O
yet	O
known	O
.	O
</s>
<s>
Chunked	B-Protocol
encoding	I-Protocol
has	O
the	O
benefit	O
that	O
it	O
is	O
not	O
necessary	O
to	O
generate	O
the	O
full	O
content	O
before	O
writing	O
the	O
header	O
,	O
as	O
it	O
allows	O
streaming	B-Architecture
of	O
content	O
as	O
chunks	O
and	O
explicitly	O
signaling	O
the	O
end	O
of	O
the	O
content	O
,	O
making	O
the	O
connection	O
available	O
for	O
the	O
next	O
HTTP	B-Protocol
request/response	O
.	O
</s>
<s>
Chunked	B-Protocol
encoding	I-Protocol
allows	O
the	O
sender	O
to	O
send	O
additional	O
header	O
fields	O
after	O
the	O
message	O
body	O
.	O
</s>
<s>
Without	O
chunked	B-Protocol
encoding	I-Protocol
,	O
the	O
sender	O
would	O
have	O
to	O
buffer	O
the	O
content	O
until	O
it	O
was	O
complete	O
in	O
order	O
to	O
calculate	O
a	O
field	O
value	O
and	O
send	O
it	O
before	O
the	O
content	O
.	O
</s>
<s>
For	O
version	O
1.1	O
of	O
the	O
HTTP	B-Protocol
protocol	I-Protocol
,	O
the	O
chunked	O
transfer	O
mechanism	O
is	O
considered	O
to	O
be	O
always	O
and	O
anyway	O
acceptable	O
,	O
even	O
if	O
not	O
listed	O
in	O
the	O
TE	O
(	O
transfer	O
encoding	O
)	O
request	O
header	O
field	O
,	O
and	O
when	O
used	O
with	O
other	O
transfer	O
mechanisms	O
,	O
should	O
always	O
be	O
applied	O
last	O
to	O
the	O
transferred	O
data	O
and	O
never	O
more	O
than	O
one	O
time	O
.	O
</s>
<s>
If	O
a	O
field	O
with	O
a	O
value	O
of	O
""	O
is	O
specified	O
in	O
an	O
HTTP	B-Protocol
message	O
(	O
either	O
a	O
request	O
sent	O
by	O
a	O
client	O
or	O
the	O
response	O
from	O
the	O
server	O
)	O
,	O
the	O
body	O
of	O
the	O
message	O
consists	O
of	O
an	O
unspecified	O
number	O
of	O
chunks	O
,	O
a	O
terminating	O
chunk	O
,	O
trailer	O
,	O
and	O
a	O
final	O
CRLF	O
sequence	O
(	O
i.e.	O
</s>
<s>
Each	O
chunk	O
starts	O
with	O
the	O
number	O
of	O
octets	O
of	O
the	O
data	O
it	O
embeds	O
expressed	O
as	O
a	O
hexadecimal	O
number	O
in	O
ASCII	B-Protocol
followed	O
by	O
optional	O
parameters	O
(	O
chunk	O
extension	O
)	O
and	O
a	O
terminating	O
CRLF	O
sequence	O
,	O
followed	O
by	O
the	O
chunk	O
data	O
.	O
</s>
<s>
These	O
parameters	O
could	O
be	O
used	O
for	O
a	O
running	O
message	B-Algorithm
digest	I-Algorithm
or	O
digital	O
signature	O
,	O
or	O
to	O
indicate	O
an	O
estimated	O
transfer	O
progress	O
,	O
for	O
instance	O
.	O
</s>
<s>
HTTP	B-Protocol
servers	O
often	O
use	O
compression	B-General_Concept
to	O
optimize	O
transmission	O
,	O
for	O
example	O
with	O
or	O
.	O
</s>
<s>
If	O
both	O
compression	B-General_Concept
and	O
chunked	B-Protocol
encoding	I-Protocol
are	O
enabled	O
,	O
then	O
the	O
content	O
stream	O
is	O
first	O
compressed	O
,	O
then	O
chunked	O
;	O
so	O
the	O
chunk	O
encoding	O
itself	O
is	O
not	O
compressed	O
,	O
and	O
the	O
data	O
in	O
each	O
chunk	O
is	O
not	O
compressed	O
individually	O
.	O
</s>
