Skip to content

Commit

Permalink
changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Apr 26, 2023
1 parent 56b47fd commit 2e4cec7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changesets/fix_geal_fix_defer_compression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Fix compression for deferred responses ([Issue #1572](https://github.com/apollographql/router/issues/1572))

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.

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.

By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2986

0 comments on commit 2e4cec7

Please sign in to comment.