compress_response
HTTP
v25
Preview
1
2
3
4
5
6
7
8
9
10
import
{
gzip
}
from
"npm:pako"
;
export
default
async
function
(
req
:
Request
)
:
Promise
<
Response
>
{
return
new
Response
(
await
gzip
(
"hi"
.
repeat
(
250_000
)
)
,
{
headers
:
{
"Content-Encoding"
:
"gzip"
,
"Content-Type"
:
"text/plain"
,
}
,
}
)
;
}
Browser preview