Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OWIN compression middleware for selfhost scenario

We have an OWIN application (built with Nancy and WebAPI).

When hosting it in a console application (with Katana selfhost), I don't have any compression enabled on static content.

I've tried to look for a working example of OWIN GZip middleware.

So far found a few like: Owin.Compression nuget, SqueezeMe nuget, https://gist.github.com/PinpointTownes/538cde1ed5e5d768355d and https://gist.github.com/PinpointTownes/ac7059733afcf91ec319

nothing seems to work - in the end the browser gets all responses without the Content-Encoding header and not compressed.

Tried adding compression in the end of Nancy's pipeline - doesn't work either.

While hosting in IIS - the IIS takes care of the compression.

Am I missing something? Is there something that overwrites the response body stream and removes the headers? Or, maybe, the host itself should take care of the compression?

From additional reading, this could be related to the Katana host. But the issue also happens in Nowin host.

Thanks.

like image 963
Aryéh Radlé Avatar asked Dec 18 '25 11:12

Aryéh Radlé


1 Answers

Bottom line: The issue was not related to anything mentioned above. It appears that ESET AV monitors all HTTP traffic in the company. In case of a compressed response ESET decompresses it before it gets to any client (even in fiddler the request appears as not compressed).

See more here: https://community.virginmedia.com/t5/Email-Cloud-and-webspace/Is-Virgin-disabling-GZIP-compression-on-websites/td-p/2851488/page/2

like image 164
Aryéh Radlé Avatar answered Dec 21 '25 03:12

Aryéh Radlé



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!