Page 1 of 1

Web API and Compression

PostPosted: Tue Jan 30, 2018 2:16 pm
by SBarnes
Hi Mike,

Does the API support compression such as gzip as I know that SearviceStack does, and is there anything special that needs to be done to enable it?

The reason for my question is that we have a client who wants a web cart developed but wants to house the database in house and have the web site call back to their office live and I am examining what might be the possible performance bottlenecks.

Re: Web API and Compression  Topic is solved

PostPosted: Tue Jan 30, 2018 2:26 pm
by Mike.Sheen
Hi Stuart,

By default all our routes return compressed responses if the caller includes the Accept gzip or Accept deflate request header

Services can control if they support compression by decorating the service classes with the [CompressResponse] attribute.

If using a ServiceStack client you can also compress the request by setting the RequestCompressionType property of the JsonServiceClient to CompressionTypes.GZip or CompressionTypes.Deflate.

Mike

Re: Web API and Compression

PostPosted: Tue Jan 30, 2018 2:51 pm
by SBarnes
Thanks for the quick response