V6 Compression Question

Congratulations on the big V6 release! I have a question about the updated compression support. Why do you have your own compression layer when there is already one? I’ve been using AddResponseCompression & UseResponseCompression to add compression, including Brotli, to my ServiceStack API responses, and it works great.

Cheers, was great to finally be able to get v6 out there, hopefully has a lot of features people can make use of.

Sure that can be used as a middleware in ASP .NET Core, but there’s a lot of caching functionality throughout ServiceStack that needs to save pre-computed compressed responses (which it writes directly to the OutputStream) that works on all supported hosts. The StreamCompressors is also used in ServiceClients to be able to send compressed request payloads.

Ultimately it’s all using the same underlying BrotliStream, DeflateStream, GZipStream under the hood, this is just the lightweight abstraction that makes it easier to work with.

Ok, thanks. By the way, you should use the new ZLibStream for deflate. DeflateStream is actually incorrect for HTTP use and was corrected in .NET 6. Comment here, bug here.

Oh nice, never know about ZLibStream, thx :+1:

Nice thing about the new abstractions is that this is all it takes to use ZLibStream as the default impl for Deflate in .NET6+ and DeflateStream for earlier runtimes.