Open jakeg opened 1 year ago
Any progress on this? It's such an easy win for reducing bytes over the wire.
+1
+1
I think I have a workaround solution for anyone who need gzip-compression over http response.
Given: you want to return an html in the response that can be consumed by browser.
Bun.gzipSync(htmlString);
'Content-Encoding': 'gzip'
so this my simple code :
Bun.serve({
fetch(req) {
const compressed = Bun.gzipSync(htmlString);
return new Response(compressed, {
headers: {
'Content-Type': 'text/html',
'Content-Encoding': 'gzip'
}
})
}
})
Any official support for this on the way?
What is the problem this feature would solve?
Currently all http responses are uncompressed.
What is the feature you are proposing to solve the problem?
Would be good to enable gzip compression for http responses.
@Jarred-Sumner says "this is a flag that the HTTP server Bun uses internally supports, but we haven't exposed it yet"
What alternatives have you considered?
No response