I am developing an ASP.NET application, hosted by IIS. I have activated IIS text compression, so all the pages served are automatically GZipped (if client requesting them support that).
Unfortunately i don't find a way to tell Swashbuckle to apply compression to API responses, so that produced API responses are somewhat compressed.
Is it a feature supported by the tool? if so how should I proceede to achieve that?
I have solved the problem adding this nuget package :
And this two line of code in application start :
protected void Application_Start(object sender, EventArgs e)
{
GlobalConfiguration.Configuration.MessageHandlers.Insert(0, new ServerCompressionHandler(contentSizeThreshold : 8192, new GZipCompressor(), new DeflateCompressor()));
GlobalConfiguration.Configure(WebApiConfig.Register);
}