I used the nuget package Microsoft.AspNet.WebApi.MessageHandlers.Compression for implementing compression for the web api following the steps mentioned in the below link:
If I do not setup the threshold and go with the default code details in the App_Start\WebApiConfig.cs:
config.MessageHandlers.Insert(0, new ServerCompressionHandler(new GZipCompressor(), new DeflateCompressor()));
I see in the Fiddler that the response is getting compressed. But once I set the threshold value as per the advanced usage details :
config.MessageHandlers.Insert(0, new ServerCompressionHandler(4096, new GZipCompressor(), new DeflateCompressor()));
I see in the Fiddler that the response is not getting compressed even if the Content-Length is more than 4096 bytes.
I am testing it using VS2013 premium and IIS express.
Can any help me to know is there any else I am missing out anything else.
Hi,
I used the nuget package Microsoft.AspNet.WebApi.MessageHandlers.Compression for implementing compression for the web api following the steps mentioned in the below link:
https://github.com/azzlack/Microsoft.AspNet.WebApi.MessageHandlers.Compression
If I do not setup the threshold and go with the default code details in the App_Start\WebApiConfig.cs:
config.MessageHandlers.Insert(0, new ServerCompressionHandler(new GZipCompressor(), new DeflateCompressor())); I see in the Fiddler that the response is getting compressed. But once I set the threshold value as per the advanced usage details :
config.MessageHandlers.Insert(0, new ServerCompressionHandler(4096, new GZipCompressor(), new DeflateCompressor())); I see in the Fiddler that the response is not getting compressed even if the Content-Length is more than 4096 bytes.
I am testing it using VS2013 premium and IIS express. Can any help me to know is there any else I am missing out anything else.