Skip to content

Commit 2e4cec7

Browse files
committed
changeset
1 parent 56b47fd commit 2e4cec7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### Fix compression for deferred responses ([Issue #1572](https://github.com/apollographql/router/issues/1572))
2+
3+
We replace tower-http's `CompressionLayer` with a custom stream transformation. This is necessary because tower-http uses async-compression, which buffers data until the end of the stream to then write it, ensuring a better compression. This is incompatible with the multipart protocol for `@defer`, which requires chunks to be sent as soon as possible. So we need to compress them independently.
4+
5+
This extracts parts of the codec module of async-compression, which so far is not public, and makes a streaming wrapper above it that flushes the compressed data on every response in the stream.
6+
7+
By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2986

0 commit comments

Comments
 (0)